diff options
| author | tslil clingman <tslil@posteo.de> | 2023-09-12 21:07:47 +0200 |
|---|---|---|
| committer | tslil clingman <tslil@posteo.de> | 2023-09-12 21:08:54 +0200 |
| commit | 8607fd0b5d3cb9efcd4bd805321128713823271d (patch) | |
| tree | a8e977963943f56f42388449fc2a334a58f550eb /emacs/inits | |
| parent | f749a8ac8423e11739ff1315d1ff50256f565d95 (diff) | |
[emacs] misc config updates
Diffstat (limited to 'emacs/inits')
| -rw-r--r-- | emacs/inits/01-basic.el | 48 | ||||
| -rw-r--r-- | emacs/inits/11-completion.el | 107 | ||||
| -rw-r--r-- | emacs/inits/13-ibuffer.el | 77 | ||||
| -rw-r--r-- | emacs/inits/20-programming.el | 327 | ||||
| -rw-r--r-- | emacs/inits/21-functional.el | 4 | ||||
| -rw-r--r-- | emacs/inits/23-text-related.el | 13 | ||||
| -rw-r--r-- | emacs/inits/24-latex.el | 200 | ||||
| -rw-r--r-- | emacs/inits/27-gemini.el | 38 | ||||
| -rw-r--r-- | emacs/inits/60-misc-configs.el | 29 | ||||
| -rw-r--r-- | emacs/inits/70-global-keybinds.el | 4 |
10 files changed, 418 insertions, 429 deletions
diff --git a/emacs/inits/01-basic.el b/emacs/inits/01-basic.el index fab9724..f1511a3 100644 --- a/emacs/inits/01-basic.el +++ b/emacs/inits/01-basic.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2022-05-04 21h32 CDT (hobbies)> +;; Time-stamp: <2023-08-07 09h15 CEST (anker)> ;; ----------------------------------------------------------------------------- ;; Interface @@ -29,18 +29,42 @@ (enlarge-window-horizontally (- (+ 1 fill-column) ww))))) (global-set-key (kbd "C-c 3") (lambda () - (interactive) - (split-window-horizontally) - (enlarge-to-fill))) + (interactive) + (split-window-horizontally) + (enlarge-to-fill))) (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/") -(when (eq 'x (window-system)) - (load-theme 'acme t) - (set-face-attribute 'font-lock-comment-face nil :slant 'italic) +(use-package circadian + :ensure t + :config + (setq calendar-latitude 52.34 + calendar-longitude 4.87 + circadian-themes '(("07:30" . acme) + ("15:00" . modus-operandi) + (:sunset . nord))) + (circadian-setup)) + +;; (defun my-disable-bold-fonts () +;; (interactive) +;; (mapc +;; (lambda (face) +;; (set-face-attribute face nil :weight 'normal)) +;; (face-list))) + +;; (my-disable-bold-fonts) + +(when 't + (setq my-font "PxPlus IBM VGA 9x16-24") + (setq my-font "Sudo-22") + (setq my-font "Commit Mono-23") + (set-face-attribute 'fixed-pitch-serif nil :font my-font) + (set-face-attribute 'fixed-pitch nil :font my-font) + (set-face-attribute 'default nil :font my-font) + (set-face-attribute 'font-lock-comment-face nil :font my-font :slant 'italic) ;; (set-face-attribute 'region nil :background "orange") - (set-face-attribute 'default nil :font "Hermit-14") - (set-face-attribute 'variable-pitch nil :font "Frank Ruehl CLM-18")) + (set-face-attribute 'variable-pitch nil :font my-font) + ) (setq-default line-spacing nil) @@ -77,7 +101,7 @@ (show-paren-mode t) (setq-default truncate-lines t - truncate-partial-width-windows nil) + truncate-partial-width-windows nil) (setq scroll-step 1 scroll-margin 5) @@ -123,5 +147,5 @@ initial-buffer-choice t) (add-hook 'after-init-hook - (lambda () - (setq default-directory "~/"))) + (lambda () + (setq default-directory "~/"))) diff --git a/emacs/inits/11-completion.el b/emacs/inits/11-completion.el index 9cf6e19..1543eff 100644 --- a/emacs/inits/11-completion.el +++ b/emacs/inits/11-completion.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2022-08-09 08h10 CEST (anchor)> +;; Time-stamp: <2023-02-11 10h47 CET (anker)> ;; ----------------------------------------------------------------------------- ;; Vertico @@ -15,8 +15,8 @@ :ensure t :config (setq orderless-component-separator 'orderless-escapable-split-on-space - completion-styles '(orderless basic) - completion-category-overrides '((file (styles basic partial-completion))))) + completion-styles '(orderless basic) + completion-category-overrides '((file (styles basic))))) (use-package savehist :ensure t @@ -34,7 +34,7 @@ ;; Do not allow the cursor in the minibuffer prompt (setq minibuffer-prompt-properties - '(read-only t cursor-intangible t face minibuffer-prompt)) + '(read-only t cursor-intangible t face minibuffer-prompt)) (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) ;; Enable recursive minibuffers @@ -46,53 +46,53 @@ (use-package consult :ensure t :bind (;; C-c bindings (mode-specific-map) - ("C-c h" . consult-history) - ("C-c m" . consult-mode-command) - ("C-c b" . consult-bookmark) - ("C-c k" . consult-kmacro) - ;; C-x bindings (ctl-x-map) - ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command - ("C-x b" . consult-buffer) ;; orig. switch-to-buffer - ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window - ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame - ;; Custom M-# bindings for fast register access - ("M-#" . consult-register-load) - ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) - ("C-M-#" . consult-register) - ;; Other custom bindings - ("M-y" . consult-yank-pop) ;; orig. yank-pop - ("<help> a" . consult-apropos) ;; orig. apropos-command - ;; M-g bindings (goto-map) - ("M-g e" . consult-compile-error) - ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck - ("M-g M-g" . consult-goto-line) ;; orig. goto-line - ("M-g o" . consult-outline) ;; Alternative: consult-org-heading - ("M-g m" . consult-mark) - ("M-g k" . consult-global-mark) - ("M-g i" . consult-imenu) - ("M-g I" . consult-project-imenu) - ;; M-s bindings (search-map) - ("M-s f" . consult-find) - ("M-s L" . consult-locate) - ("C-c g" . consult-ripgrep) - ("C-c G" . consult-git-grep) - ("M-s l" . consult-line) - ("M-s m" . consult-multi-occur) - ("M-s k" . consult-keep-lines) - ("M-s u" . consult-focus-lines) - ;; Isearch integration - ("M-s e" . consult-isearch) - :map isearch-mode-map - ("M-e" . consult-isearch) ;; orig. isearch-edit-string - ("M-s e" . consult-isearch) ;; orig. isearch-edit-string - ("M-s l" . consult-line)) ;; needed by consult-line to detect isearch + ("C-c h" . consult-history) + ("C-c m" . consult-mode-command) + ("C-c b" . consult-bookmark) + ("C-c k" . consult-kmacro) + ;; C-x bindings (ctl-x-map) + ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command + ("C-x b" . consult-buffer) ;; orig. switch-to-buffer + ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window + ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame + ;; Custom M-# bindings for fast register access + ("M-#" . consult-register-load) + ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) + ("C-M-#" . consult-register) + ;; Other custom bindings + ("M-y" . consult-yank-pop) ;; orig. yank-pop + ("<help> a" . consult-apropos) ;; orig. apropos-command + ;; M-g bindings (goto-map) + ("M-g e" . consult-compile-error) + ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck + ("M-g M-g" . consult-goto-line) ;; orig. goto-line + ("M-g o" . consult-outline) ;; Alternative: consult-org-heading + ("M-g m" . consult-mark) + ("M-g k" . consult-global-mark) + ("M-g i" . consult-imenu) + ("M-g I" . consult-project-imenu) + ;; M-s bindings (search-map) + ("M-s f" . consult-find) + ("M-s L" . consult-locate) + ("C-c g" . consult-ripgrep) + ("C-c G" . consult-git-grep) + ("M-s l" . consult-line) + ("M-s m" . consult-multi-occur) + ("M-s k" . consult-keep-lines) + ("M-s u" . consult-focus-lines) + ;; Isearch integration + ("M-s e" . consult-isearch) + :map isearch-mode-map + ("M-e" . consult-isearch) ;; orig. isearch-edit-string + ("M-s e" . consult-isearch) ;; orig. isearch-edit-string + ("M-s l" . consult-line)) ;; needed by consult-line to detect isearch :init ;; Optionally configure the register formatting. This improves the register ;; preview for `consult-register', `consult-register-load', ;; `consult-register-store' and the Emacs built-ins. (setq register-preview-delay 0 - register-preview-function #'consult-register-format) + register-preview-function #'consult-register-format) ;; Optionally tweak the register preview window. ;; This adds thin lines, sorting and hides the mode line of the window. @@ -100,24 +100,15 @@ ;; Use Consult to select xref locations with preview (setq xref-show-xrefs-function #'consult-xref - xref-show-definitions-function #'consult-xref) + xref-show-definitions-function #'consult-xref) :config - (consult-customize - consult-theme - :preview-key '(:debounce 0.2 any) - - consult-ripgrep consult-git-grep consult-grep - consult-bookmark consult-recent-file consult-xref - consult--source-buffer consult--source-project-buffer consult--source-bookmark - :preview-key (kbd "M-.")) - (defun previous-history-or-next () (interactive) (if (string= "" (minibuffer-contents-no-properties)) - (progn - (previous-history-element 1) - (end-of-line)) + (progn + (previous-history-element 1) + (end-of-line)) (vertico-next))) (defvar my-consult-line-map diff --git a/emacs/inits/13-ibuffer.el b/emacs/inits/13-ibuffer.el index 55387dd..6db2a3c 100644 --- a/emacs/inits/13-ibuffer.el +++ b/emacs/inits/13-ibuffer.el @@ -1,44 +1,31 @@ -;; Time-stamp: <2021-09-27 08h47 EDT (hobbies)> +;; Time-stamp: <2022-08-19 11h19 CEST (anchor)> (use-package ibuffer :bind (("C-x C-b" . ibuffer)) :hook (ibuffer-mode . (lambda () - (ibuffer-switch-to-saved-filter-groups "default"))) + (ibuffer-switch-to-saved-filter-groups "default"))) :config (setq ibuffer-display-summary nil - ibuffer-saved-filter-groups - '(("default" - ("agda" (or (mode . agda2-mode) - (name . "^\\*[aA]gda"))) - ("coq" (or (mode . coq-mode) - (mode . coq-goals-mode) - (mode . coq-response-mode) - (mode . coq-shell-mode))) - ("c" (or (mode . c-mode) - (mode . makefile-gmake-mode))) - ("dired" (mode . dired-mode)) - ("elisp" (or (mode . emacs-lisp-mode) - (name . "^\\*Backtrace\\*"))) - ("emacs" (or (name . "^\\*scratch\\*$") - (name . "^\\*Messages\\*$") - (name . "^\\*init log\\*$") - (name . "^\\*Compile-Log\\*$") - (mode . helpful-mode) - (name . "^\\*Help\\*$"))) - ("irc" (mode . rcirc-mode)) - ("magit" (name . "^magit[:-]")) - ("REPL" (name . "^\\*.*REPL.*\\*$")) - ("rust" (mode . rust-mode)) - ("slime" (name . "^\\*slime-[^*]*\\*$")) - ("tex" (mode . latex-mode)) - ("web" (or (mode . js2-mode) - (mode . js-mode) - (mode . html-mode) - (mode . css-mode) - (mode . mhtml-mode))) - ("zig" (or (mode . zig-mode) - (name . "^\\*zig.*\\*$") - (name . "^\\*zls.*\\*$")))))) + ibuffer-saved-filter-groups + '(("default" + ("c{,++}" (or (mode . c-mode) + (mode . c++-mode) + (mode . makefile-gmake-mode))) + ("config" (or (mode . json-mode) + (mode . jinja2-mode))) + ("dired" (mode . dired-mode)) + ("elisp" (or (mode . emacs-lisp-mode) + (name . "^\\*Backtrace\\*"))) + ("emacs" (or (name . "^\\*scratch\\*$") + (name . "^\\*Messages\\*$") + (name . "^\\*init log\\*$") + (name . "^\\*Compile-Log\\*$") + (mode . helpful-mode) + (name . "^\\*Help\\*$"))) + ("magit" (name . "^magit[:-]")) + ("python" (mode . python-mode)) + ("REPL" (name . "^\\*.*REPL.*\\*$")) + ("shell" (mode . sh-mode))))) (defadvice ibuffer-update-title-and-summary (after remove-column-titles) (with-current-buffer "*Ibuffer*" @@ -47,8 +34,8 @@ (search-forward "-\n" nil t) (delete-region 1 (point)) (let ((window-min-height 1)) - ;; save a little screen estate - (shrink-window-if-larger-than-buffer)) + ;; save a little screen estate + (shrink-window-if-larger-than-buffer)) (read-only-mode 1))) (ad-activate 'ibuffer-update-title-and-summary) @@ -62,11 +49,11 @@ (t (format "%8d" (buffer-size))))) (setq ibuffer-formats - '((mark modified read-only locked " " - (name 18 18 :left :elide) - " " - (size-h 9 -1 :right) - " " - (mode 16 16 :left :elide) - " " - filename-and-process)))) + '((mark modified read-only locked " " + (name 18 18 :left :elide) + " " + (size-h 9 -1 :right) + " " + (mode 16 16 :left :elide) + " " + filename-and-process)))) diff --git a/emacs/inits/20-programming.el b/emacs/inits/20-programming.el index e13ae8c..71a5cf9 100644 --- a/emacs/inits/20-programming.el +++ b/emacs/inits/20-programming.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2023-01-18 20h59 CET (anker)> +;; Time-stamp: <2023-08-29 09h09 CEST (anker)> ;; ----------------------------------------------------------------------------- ;; General setup @@ -15,17 +15,6 @@ ;; (when (< ww (+ 5 fill-column)) ;; (enlarge-window-horizontally (- (+ 5 fill-column) ww))))) -(defun programming-setup () - (subword-mode 1) - (electric-pair-local-mode) - (set-fill-column 80) - (hs-minor-mode) - (display-line-numbers-mode 1) - (setq auto-hscroll-mode t) - (yas-minor-mode-on)) - -(add-hook 'prog-mode-hook #'programming-setup) - (defun align-to-equals (begin end) "Align region to equal signs" (interactive "r") @@ -34,9 +23,6 @@ (use-package centered-window :ensure t) -(use-package hideshow - :bind (("C-c C-f C-f" . hs-toggle-hiding))) - ;; (use-package origami ;; :ensure t ;; :bind (("C-c C-f C-f" . origami-recursively-toggle-node) @@ -46,6 +32,25 @@ ;; :config ;; (global-origami-mode -1)) +(use-package hideshow + :bind (("C-c C-f C-f" . hs-toggle-hiding))) + +(use-package treesit-auto + :ensure t + :config + (global-treesit-auto-mode) + (setq treesit-auto-install t)) + +(defun programming-setup () + (subword-mode 1) + (electric-pair-local-mode) + (set-fill-column 80) + (hs-minor-mode) + (display-line-numbers-mode 1) + (setq auto-hscroll-mode t) + (yas-minor-mode-on)) + +(add-hook 'prog-mode-hook #'programming-setup) ;; ----------------------------------------------------------------------------- ;; Specific packages @@ -53,17 +58,19 @@ (use-package shift-number :ensure t :bind (("C-c s p" . shift-number-up) - ("C-c s n" . shift-number-down))) + ("C-c s n" . shift-number-down))) (use-package comment-dwim-2 :ensure t :bind (("M-;" . comment-dwim-2)) :config (setq comment-multi-line t - comment-style 'extra-line)) + comment-style 'extra-line)) (use-package aggressive-indent :ensure t - :defer t) + :defer t + :config + (setq aggressive-indent-sit-for-time 1)) (use-package yasnippet :ensure t @@ -74,20 +81,26 @@ :defer t :config (setq electric-pair-delete-adjacent-pairs t - electric-pair-skip-self 'electric-pair-default-skip-self - electric-pair-preserve-balance t - electric-pair-skip-whitespace t - electric-pair-inhibit-predicate 'electric-pair-default-inhibit)) + electric-pair-skip-self 'electric-pair-default-skip-self + electric-pair-preserve-balance t + electric-pair-skip-whitespace t + electric-pair-inhibit-predicate 'electric-pair-default-inhibit)) (use-package lsp-mode :ensure t :defer t :init - (setq lsp-keymap-prefix "M-l")) + (setq lsp-keymap-prefix "M-l" + lsp-warn-no-matched-clients nil)) ;; ----------------------------------------------------------------------------- ;; C +;; What are these? +;; (setq gdb-show-threads-by-default nil +;; gdb-many-windows nil +;; gdb-show-main nil) + (use-package clang-format :ensure t :defer @@ -98,15 +111,17 @@ :defer t :bind (:map c-mode-map ("M-/" . lh-matching-delim)) - :hook (c-mode . (lambda () - (auto-fill-mode) - (set-fill-column 80) - (abbrev-mode 0) - (flycheck-mode 1) - (lsp) ;; clangd seems pretty good! - (c-toggle-hungry-state 1) - (c-toggle-electric-state 1) - (c-toggle-syntactic-indentation 1))) + :hook ((c-mode c++-mode) . (lambda () + (when (string-match-p (regexp-quote "rdx-code") (buffer-file-name)) + (c-set-style "radix")) + (auto-fill-mode) + ;; (aggressive-indent-mode) + (set-fill-column 80) + (abbrev-mode 0) + (lsp) ;; clangd seems pretty good! + (c-toggle-hungry-state 1) + (c-toggle-electric-state 1) + (c-toggle-syntactic-indentation 1))) :config (c-add-style "gnu-mod" '("gnu" @@ -184,11 +199,49 @@ (substatement-open . +) (template-args-cont c-lineup-template-args +) (topmost-intro-cont . c-lineup-topmost-intro-cont)))) + (c-add-style "radix" + '("gnu-mod" (c-basic-offset . 4))) (setq c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu-mod")))) +;; ----------------------------------------------------------------------------- +;; Python + +;; (use-package yapfify +;; :ensure t +;; :defer t +;; :config +;; (setq yapfify-executable "yapf3")) + +(use-package python-black + :ensure t + :after python + :config + (setq python-black-extra-args '("-l120")) + ;; :hook (python-mode . python-black-on-save-mode-enable-dwim) + ) + +(use-package highlight-indent-guides + :ensure t + :defer t + :config + (setq highlight-indent-guides-auto-odd-face-perc 1.5 ;; 10 + highlight-indent-guides-auto-even-face-perc 3 ;; 15 + )) + +(use-package python + :hook (python-mode . (lambda () + (highlight-indent-guides-mode) + (visual-line-mode) + ;; (yapf-mode) + )) + :bind (:map python-mode-map + ("C-c C-f" . nil)) + ;; :config + ;; (setq python-shell-interpreter "python3") + ) ;; ----------------------------------------------------------------------------- ;; Rust @@ -210,8 +263,8 @@ ("M-/" . lh-matching-delim) ("M-p" . beginning-of-defun) ("M-n" . end-of-defun) - ("C-c C-c" . rust-compile) - ("C-c C-r" . rust-run)) + ("C-c r c" . rust-compile) + ("C-c r r" . rust-run)) :hook (rust-mode . (lambda () (cargo-minor-mode) ;; For some reason this is not automatic @@ -230,37 +283,36 @@ (setq lsp-rust-server 'rust-analyzer lsp-rust-analyzer-call-info-full nil)) -;; ----------------------------------------------------------------------------- -;; Python -(use-package python-black - :ensure t - :after python - ;; :hook (python-mode . python-black-on-save-mode-enable-dwim) - ) +;; ------------------------------------------------------------------- +;; Misc languages -(use-package highlight-indent-guides +(use-package json-mode :ensure t :defer t - :config - (setq highlight-indent-guides-auto-odd-face-perc 1.5 ;; 10 - highlight-indent-guides-auto-even-face-perc 3 ;; 15 - )) + :mode (("\\.json\\.jinja\\'" . json-mode) + ("\\.jinja" . json-mode)) + :hook (json-mode . (lambda () + (programming-setup) + (setq standard-indent 2) + (setq js-indent-level 2) + (setq tab-width 2 + indent-tabs-mode nil))) + :bind (:map json-mode-map + ("C-c C-f" . nil))) -(use-package python - :hook (python-mode . (lambda () +(use-package jinja2-mode + :ensure t + :defer t + :mode ("\\.jinja\\'" . jinja2-mode) + :hook (jinja2-mode . (lambda () + (setq indent-line-function 'indent-relative) (highlight-indent-guides-mode) - (visual-line-mode) - ;; (yapf-mode) - )) - :bind (:map python-mode-map - ("C-c C-f" . nil)) - ;; :config - ;; (setq python-shell-interpreter "python3") - ) - -;; ----------------------------------------------------------------------------- -;; Zig + (programming-setup) + (spell-fu-mode -1) + (auto-fill-mode -1))) + :bind (:map jinja2-mode-map + ("C-c C-f" . nil))) (use-package zig-mode :ensure t @@ -282,138 +334,53 @@ :config (require 'lsp) (setq zig-format-on-save nil - lsp-zig-zls-executable "~/.local/bin/zls")) + lsp-zig-zls-executable "/usr/bin/zls")) -;; ------------------------------------------------------------------- -;; OCaml - -;; (use-package utop +;; (use-package js-comint ;; :ensure t ;; :defer t ;; :config -;; (setq utop-command "opam config exec -- utop -emacs")) +;; (setq js-comint-program-command "node" +;; js-comint-program-arguments nil)) -;; (use-package tuareg +;; (use-package js2-mode ;; :ensure t ;; :defer t -;; :hook (tuareg-mode . (lambda () -;; (utop-minor-mode)))) - -;; ------------------------------------------------------------------- -;; Misc languages - -(use-package js-comint - :ensure t - :defer t - :config - (setq js-comint-program-command "node" - js-comint-program-arguments nil)) - -(use-package js2-mode - :ensure t - :defer t - :after js-comint - :mode "\\.js$" - :bind (:map js2-mode-map - ("TAB" . js2-indent-line) - ("C-x C-e" . js-send-last-sexp) - ("C-c C-b" . js-send-buffer) - ("C-c C-l" . js-load-file)) - :hook (js2-mode . (lambda () - (auto-revert-mode -1) - (yas-minor-mode-on)))) - -(use-package nodemcu-mode - :ensure t - :defer t - :config - (setq nodemcu-default-keybindings t - nodemcu-port "/dev/ttyUSB0" - nodemcu-backend "nodemcu-uploader") - - (defun nodemcu-better-upload-current-file (&optional noreset) - (interactive "P") - (let ((proc (get-process "nodemcu-terminal"))) - (when proc - (delete-process proc)) - (shell-command - (nodemcu--get-command "upload" (file-name-nondirectory (buffer-file-name)))) - (unless noreset - (shell-command - (nodemcu--get-command "node restart")) - (when proc - (nodemcu-terminal)))))) - -(use-package lua-mode - :after nodemcu-mode - :ensure t - :defer t - :bind (:map lua-mode-map - ("C-x C-e" . lua-send-current-line) - ("C-c C-d" . lua-send-defun) - ("C-c C-e" . lua-send-region) - ("C-c C-u" . nodemcu-better-upload-current-file) - ("C-c C-t" . nodemcu-terminal) - ("M-n" . lua-forward-sexp) - ("M-p" . lua-backwards-to-block-begin-or-end)) - :hook (lua-mode . (lambda () - (require 'nodemcu-mode) - (nodemcu-mode 1)))) - -(use-package verilog-mode - :ensure t - :defer t - :mode "\\.vl$" - :hook (verilog-mode . (lambda () - (setq verilog-tool 'verilog-compiler) - (verilog-set-compile-command))) - :config - (setq verilog-compiler "iverilog" - verilog-tool 'verilog-compiler)) - -(use-package gforth - :commands forth-mode - :mode (("\\.fs$" . forth-mode) - ("\\.fb$" . forth-block-mode) - ("\\.4th$" . forth-mode))) - -;; (use-package clojure-mode +;; :after js-comint +;; :mode "\\.js$" +;; :bind (:map js2-mode-map +;; ("TAB" . js2-indent-line) +;; ("C-x C-e" . js-send-last-sexp) +;; ("C-c C-b" . js-send-buffer) +;; ("C-c C-l" . js-load-file)) +;; :hook (js2-mode . (lambda () +;; (auto-revert-mode -1) +;; (yas-minor-mode-on)))) + +;; (use-package lua-mode +;; :after nodemcu-mode ;; :ensure t -;; :defer t) +;; :defer t +;; :bind (:map lua-mode-map +;; ("C-x C-e" . lua-send-current-line) +;; ("C-c C-d" . lua-send-defun) +;; ("C-c C-e" . lua-send-region) +;; ("C-c C-u" . nodemcu-better-upload-current-file) +;; ("C-c C-t" . nodemcu-terminal) +;; ("M-n" . lua-forward-sexp) +;; ("M-p" . lua-backwards-to-block-begin-or-end)) +;; :hook (lua-mode . (lambda () +;; (require 'nodemcu-mode) +;; (nodemcu-mode 1)))) + +;; (use-package gforth +;; :commands forth-mode +;; :mode (("\\.fs$" . forth-mode) +;; ("\\.fb$" . forth-block-mode) +;; ("\\.4th$" . forth-mode))) (use-package uxntal-mode :ensure t :defer t :config (setq uxntal-mode-strict-comments t)) - - -;; ------------------------------------------------------------------- -;; JSON and related - -(use-package json-mode - :ensure t - :defer t - :mode (("\\.json\\.jinja\\'" . json-mode) - ("\\.jinja" . json-mode)) - :hook (json-mode . (lambda () - (programming-setup) - (setq standard-indent 2) - (setq js-indent-level 2) - (setq tab-width 2 - indent-tabs-mode nil))) - :bind (:map json-mode-map - ("C-c C-f" . nil))) - -(use-package jinja2-mode - :ensure t - :defer t - :mode ("\\.jinja\\'" . jinja2-mode) - :hook (jinja2-mode . (lambda () - (setq indent-line-function 'indent-relative) - (highlight-indent-guides-mode) - (programming-setup) - (spell-fu-mode -1) - (auto-fill-mode -1))) - :bind (:map jinja2-mode-map - ("C-c C-f" . nil))) diff --git a/emacs/inits/21-functional.el b/emacs/inits/21-functional.el index d9e4214..1eaa104 100644 --- a/emacs/inits/21-functional.el +++ b/emacs/inits/21-functional.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2021-09-27 08h48 EDT (hobbies)> +;; Time-stamp: <2023-01-18 20h56 CET (anker)> ;; ----------------------------------------------------------------------------- ;; Haskell @@ -26,7 +26,7 @@ (interactive-haskell-mode) (turn-on-haskell-doc-mode) (turn-on-haskell-decl-scan) - (lsp) + (lsp) (haskell-mode-stylish-buffer)))) :config (setq haskell-doc-show-global-types t diff --git a/emacs/inits/23-text-related.el b/emacs/inits/23-text-related.el index 8aac63e..797b0d0 100644 --- a/emacs/inits/23-text-related.el +++ b/emacs/inits/23-text-related.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2020-05-17 15:35:55 (tslil@bison)> +;; Time-stamp: <2023-01-13 12h54 CET (anker)> ;; ----------------------------------------------------------------------------- ;; Spelling @@ -79,6 +79,17 @@ (use-package dictionary :ensure t :defer t) ;; ----------------------------------------------------------------------------- +;; Markdown + +(use-package markdown-mode + :ensure t + :defer t + :hook (markdown-mode . (lambda () + (auto-fill-mode -1) + (visual-line-mode)))) + + +;; ----------------------------------------------------------------------------- ;; Org (use-package org diff --git a/emacs/inits/24-latex.el b/emacs/inits/24-latex.el index 83865af..4922cf1 100644 --- a/emacs/inits/24-latex.el +++ b/emacs/inits/24-latex.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2022-04-17 16h03 EDT (academic)> +;; Time-stamp: <2023-07-15 19h45 CEST (anker)> (defvar latex-template-dir (expand-file-name "~/typeset/latex-templates")) (defun prompt-latex-file-template () @@ -7,17 +7,17 @@ interactively. If neither, prompt to insert from a template populated from the directory *latex-template-dir*" (interactive) (when (and (if (file-exists-p (buffer-file-name)) - (called-interactively-p 'interactive) - t) - (yes-or-no-p "Insert template?")) + (called-interactively-p 'interactive) + t) + (yes-or-no-p "Insert template?")) (let* ((tfiles (directory-files latex-template-dir nil "\\.tex")) - (template (completing-read "Select template: " tfiles nil t))) + (template (completing-read "Select template: " tfiles nil t))) (when template - (goto-char (point-min)) - (insert-file-contents (concat latex-template-dir "/" template)) - (search-forward "begin{document}") - (forward-line) - (save-buffer))))) + (goto-char (point-min)) + (insert-file-contents (concat latex-template-dir "/" template)) + (search-forward "begin{document}") + (forward-line) + (save-buffer))))) (use-package cdm-mode :load-path "~/.emacs.d/scripts/") @@ -27,21 +27,21 @@ populated from the directory *latex-template-dir*" (use-package latex :ensure auctex :bind (:map LaTeX-mode-map - ("<" . LaTeX-insert-left-brace) - ;; ("|" . LaTeX-insert-left-brace) - ("'" . better-TeX-insert-single-quote) - ;; ("TAB" . LaTeX-indent-line) - ("M-TAB" . TeX-complete-symbol) - ("M-q" . unfill-paragraph) - ("C-c e" . LaTeX-environment) - ("C-c C-d" . TeX-view)) + ("<" . LaTeX-insert-left-brace) + ;; ("|" . LaTeX-insert-left-brace) + ("'" . better-TeX-insert-single-quote) + ;; ("TAB" . LaTeX-indent-line) + ("M-TAB" . TeX-complete-symbol) + ("M-q" . unfill-paragraph) + ("C-c e" . LaTeX-environment) + ("C-c C-d" . TeX-view)) :hook (LaTeX-mode . (lambda () - (latex-setup-visual-aesthetics) - (latex-setup-text-environment) - (latex-setup-special-minor-modes) - (latex-setup-completions) - (prompt-latex-file-template))) + (latex-setup-visual-aesthetics) + (latex-setup-text-environment) + (latex-setup-special-minor-modes) + (latex-setup-completions) + (prompt-latex-file-template))) :init (defun latex-setup-visual-aesthetics () (interactive) @@ -76,37 +76,37 @@ populated from the directory *latex-template-dir*" (defun better-TeX-insert-single-quote () (interactive) (let ((old-open TeX-open-quote) - (old-close TeX-close-quote)) + (old-close TeX-close-quote)) (unwind-protect (progn - (setq TeX-open-quote "`" - TeX-close-quote "'") - (call-interactively 'TeX-insert-quote)) - (setq TeX-open-quote old-open - TeX-close-quote old-close)))) + (setq TeX-open-quote "`" + TeX-close-quote "'") + (call-interactively 'TeX-insert-quote)) + (setq TeX-open-quote old-open + TeX-close-quote old-close)))) :config (setq TeX-debug-bad-boxes t - TeX-command-list '(("XeLaTeX" "xelatex %t" - TeX-run-TeX nil (latex-mode doctex-mode) :help "Run XeLaTeX") - ("TeX" "%(PDF)%(tex) %(file-line-error) %`%(extraopts) %S%(PDFout)%(mode)%' %t" - TeX-run-TeX nil (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run plain TeX") - ("LaTeX" "%`%l%(mode)%' %T" - TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX") - ("Biber" "biber %s %(output-dir)" TeX-run-Biber nil - (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Run Biber") - ("BibTeX" "bibtex %s" TeX-run-BibTeX nil - (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode context-mode) :help "Run BibTeX") - ("View" "%V" TeX-run-discard-or-function t t :help "Run External Viewer") - ("View internally" "(find-file \"%o\")" TeX-run-function nil t :help "Run Viewer") - ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document") - ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated intermediate files") - ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help "Delete generated intermediate and output files") - ("Other" "" TeX-run-command t t :help "Run an arbitrary command"))) + TeX-command-list '(("XeLaTeX" "xelatex %t" + TeX-run-TeX nil (latex-mode doctex-mode) :help "Run XeLaTeX") + ("TeX" "%(PDF)%(tex) %(file-line-error) %`%(extraopts) %S%(PDFout)%(mode)%' %t" + TeX-run-TeX nil (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run plain TeX") + ("LaTeX" "%`%l%(mode)%' %T" + TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX") + ("Biber" "biber %s %(output-dir)" TeX-run-Biber nil + (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help "Run Biber") + ("BibTeX" "bibtex %s" TeX-run-BibTeX nil + (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode context-mode) :help "Run BibTeX") + ("View" "%V" TeX-run-discard-or-function t t :help "Run External Viewer") + ("View internally" "(find-file \"%o\")" TeX-run-function nil t :help "Run Viewer") + ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document") + ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated intermediate files") + ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help "Delete generated intermediate and output files") + ("Other" "" TeX-run-command t t :help "Run an arbitrary command"))) (setq TeX-electric-sub-and-superscript t - TeX-electric-math '("$" . "$") - TeX-electric-escape nil - LaTeX-electric-left-right-brace t) + TeX-electric-math '("$" . "$") + TeX-electric-escape nil + LaTeX-electric-left-right-brace t) ;; no idea why this is not a default ... ? (push '("<" . ">") TeX-braces-association) @@ -114,13 +114,13 @@ populated from the directory *latex-template-dir*" (setq reftex-plug-into-AUCTeX t) ;; (setq-default TeX-master nil) (setq TeX-auto-save t - TeX-parse-self t - TeX-PDF-mode t - TeX-source-correlate-mode 'synctex - TeX-view-program-selection '(((output-dvi style-pstricks) "dvips and gv") - (output-dvi "xdvi") - (output-pdf "Zathura") - (output-html "xdg-open"))) + TeX-parse-self t + TeX-PDF-mode t + TeX-source-correlate-mode 'synctex + TeX-view-program-selection '(((output-dvi style-pstricks) "dvips and gv") + (output-dvi "xdvi") + (output-pdf "Zathura") + (output-html "xdg-open"))) ;; for PDF tools ;; (add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer) @@ -130,50 +130,50 @@ populated from the directory *latex-template-dir*" (use-package cdlatex :ensure t :bind (:map cdlatex-mode-map - ("(" . nil) - ("{" . nil) - ("[" . nil) - ("|" . nil) - ("<" . nil) - ("'" . nil) - ("TAB" . cdlatex-tab) - ;; ("C-c e" . cdlatex-environment) - ("~" . cdlatex-math-modify) - ("`" . cdlatex-math-symbol)) + ("(" . nil) + ("{" . nil) + ("[" . nil) + ("|" . nil) + ("<" . nil) + ("'" . nil) + ("TAB" . cdlatex-tab) + ;; ("C-c e" . cdlatex-environment) + ("~" . cdlatex-math-modify) + ("`" . cdlatex-math-symbol)) :init (setq cdlatex-math-modify-prefix ?~ - cdlatex-math-symbol-prefix ?` - cdlatex-math-modify-alist '((?a "\\mathbb" nil t nil nil) - (?c "\\mathcal" "\\textsc" t nil nil) - (?v "\\texttt" "\\texttt" t nil nil) - (?k "\\mathfrak" nil t nil nil) - (?- "\\overline" nil t nil nil) - (?_ "\\underline" nil t nil nil)) - cdlatex-math-symbol-alist '((?^ ("\\widehat{?}" "\\hat{?}")) - (?' ("^{\\prime}" "\\prime")) - (?* ("\\times" "\\otimes" "\\star")) - (?+ ("+" "\\oplus")) - (?- ("\\dashv" "\\vdash" "\\setminus")) - (?. ("\\circ" "\\sq" "\\cdot")) - (?0 ("\\emptyset" "\\circ")) - (?< ("\\leftarrow" "\\leftharpoonup" "\\xleftarrow")) - (?> ("\\to" "\\rightharpoonup" "\\xrightarrow")) - (?B ("\\bullet")) - (?C ("\\widecheck{?}" "\\check{?}")) - (?f ("\\varphi" "\\phi")) - (?F ("\\Phi" "\\Varphi")) - (?M ("\\begin{bsmallmatrix}?\\end{bsmallmatrix}")) - (?P ("\\Prod{?}" "\\Pi" "\\partial")) - (?S ("\\Sum{?}" "\\Sigma" "\\arcsin")) - (?\"("^{\\prime\\prime}" "\\prime\\prime")) - (?a ("\\alpha" "\\cap" "\\sqcap")) - (?c ("\\cat{?}" "\\catn{?}")) - (?e ("\\varepsilon" "\\epsilon" "\\exp{?}")) - (?i ("\\iota" "\\in")) - (?j ("{\\id^{h}}_{?}" "{\\id^{v}}_{?}")) - (?r ("\\rho" "\\varrho" "\\restrict{?}")) - (?u ("\\upsilon" "\\cup" "\\sqcup")) - (?y ("\\psi" "\\Psi")) - (?{ ("\\subseteq" "\\subsetneq")) - (?} ("\\supseteq" "\\supsetneq")) - ))) + cdlatex-math-symbol-prefix ?` + cdlatex-math-modify-alist '((?a "\\mathbb" nil t nil nil) + (?c "\\mathcal" "\\textsc" t nil nil) + (?v "\\texttt" "\\texttt" t nil nil) + (?k "\\mathfrak" nil t nil nil) + (?- "\\overline" nil t nil nil) + (?_ "\\underline" nil t nil nil)) + cdlatex-math-symbol-alist '((?^ ("\\widehat{?}" "\\hat{?}")) + (?' ("^{\\prime}" "\\prime")) + (?* ("\\times" "\\otimes" "\\star")) + (?+ ("+" "\\oplus")) + (?- ("\\dashv" "\\vdash" "\\setminus")) + (?. ("\\circ" "\\sq" "\\cdot")) + (?0 ("\\emptyset" "\\circ")) + (?< ("\\leftarrow" "\\leftharpoonup" "\\xleftarrow")) + (?> ("\\to" "\\rightharpoonup" "\\xrightarrow")) + (?B ("\\bullet")) + (?C ("\\widecheck{?}" "\\check{?}")) + (?f ("\\varphi" "\\phi")) + (?F ("\\Phi" "\\Varphi")) + (?M ("\\begin{bsmallmatrix}?\\end{bsmallmatrix}")) + (?P ("\\Prod{?}" "\\Pi" "\\partial")) + (?S ("\\Sigma" "\\Sum{?}" "\\arcsin")) + (?\"("^{\\prime\\prime}" "\\prime\\prime")) + (?a ("\\alpha" "\\cap" "\\sqcap")) + (?c ("\\cat{?}" "\\catn{?}")) + (?e ("\\varepsilon" "\\epsilon" "\\exp{?}")) + (?i ("\\iota" "\\in")) + (?j ("{\\id^{h}}_{?}" "{\\id^{v}}_{?}")) + (?r ("\\rho" "\\varrho" "\\restrict{?}")) + (?u ("\\upsilon" "\\cup" "\\sqcup")) + (?y ("\\psi" "\\Psi")) + (?{ ("\\subseteq" "\\subsetneq")) + (?} ("\\supseteq" "\\supsetneq")) + ))) diff --git a/emacs/inits/27-gemini.el b/emacs/inits/27-gemini.el index 65a499d..26a4724 100644 --- a/emacs/inits/27-gemini.el +++ b/emacs/inits/27-gemini.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2021-09-27 08h48 EDT (hobbies)> +;; Time-stamp: <2023-01-18 20h54 CET (anker)> (use-package elpher :ensure t @@ -8,7 +8,7 @@ :ensure t :defer) -(defvar gemlog-directory (expand-file-name "~/hobbies/l-3.space/")) +(defvar gemlog-directory (expand-file-name "~/logs/l-3.space/")) (defvar gemlog-file-name "%y%02m%02d") (defvar gemlog-time-string "%Y-%02m-%02d %02Hh%02M %Z") (defvar gemlog-time-zone "UTC") @@ -16,20 +16,20 @@ (defun gemlog-new-entry () (interactive) (let* ((title (read-string "Title: ")) - (number 1) - (file (format "%s/log-%s-%d.gmi" - gemlog-directory - (format-time-string gemlog-file-name nil t) - number))) + (number 1) + (file (format "%s/log-%s-%d.gmi" + gemlog-directory + (format-time-string gemlog-file-name nil t) + number))) (while (file-exists-p file) (setq number (+ 1 number)) (setq file (format "%s/log-%s-%d.gmi" - gemlog-directory - (format-time-string gemlog-file-name nil t) - number))) + gemlog-directory + (format-time-string gemlog-file-name nil t) + number))) (find-file file) (setq-local time-stamp-time-zone gemlog-time-zone - time-stamp-format gemlog-time-string) + time-stamp-format gemlog-time-string) (insert "Time-stamp: <>") (newline) (newline) (insert "# " title) (newline) (newline) (time-stamp))) @@ -39,10 +39,10 @@ (defun gemini-insert-footnote () (interactive) (let ((symb (car gemini-footnote-symbols)) - (n 0)) + (n 0)) (while (and symb (save-excursion (beginning-of-buffer) (search-forward symb nil t))) (setq n (1+ n) - symb (nth n gemini-footnote-symbols))) + symb (nth n gemini-footnote-symbols))) (if (not symb) (message "Ran out of footnote symbols. Customise `gemini-footnote-symbols'.") (insert symb) (end-of-buffer) @@ -52,10 +52,10 @@ (use-package gemini-mode :ensure t :bind (:map gemini-mode-map - ("C-c C-f" . gemini-insert-footnote)) + ("C-c C-f" . gemini-insert-footnote)) :hook (gemini-mode . (lambda () - (setq time-stamp-time-zone gemlog-time-zone - time-stamp-format gemlog-time-string) - (setq-local indent-tabs-mode nil) - (auto-fill-mode -1) - (set-fill-column 80)))) + (setq time-stamp-time-zone gemlog-time-zone + time-stamp-format gemlog-time-string) + (setq-local indent-tabs-mode nil) + (auto-fill-mode -1) + (set-fill-column 80)))) diff --git a/emacs/inits/60-misc-configs.el b/emacs/inits/60-misc-configs.el index 4df81e0..1da810e 100644 --- a/emacs/inits/60-misc-configs.el +++ b/emacs/inits/60-misc-configs.el @@ -1,22 +1,33 @@ -;; Time-stamp: <2021-09-27 08h49 EDT (hobbies)> +;; Time-stamp: <2022-11-16 07h55 CET (anker)> (use-package dired :defer t :config (setq dired-listing-switches "--group-directories-first -alh" - dired-auto-revert-buffer t - dired-dwim-target t - ;; ??? - ;; dired-guess-shell-alist-user '(("\\.djvu\\'" "zathura") - ;; ("\\.pdf\\'" "zathura") - ;; ("\\.ps\\'" "zathura")) - )) + dired-auto-revert-buffer t + dired-dwim-target t + ;; ??? + ;; dired-guess-shell-alist-user '(("\\.djvu\\'" "zathura") + ;; ("\\.pdf\\'" "zathura") + ;; ("\\.ps\\'" "zathura")) + )) (use-package browse-url :defer t :config (setq browse-url-generic-program "firefox" - browse-url-browser-function 'browse-url-default-browser)) + browse-url-browser-function 'browse-url-default-browser)) (setq backup-directory-alist `((".*" . ,temporary-file-directory)) auto-save-file-name-transforms `((".*" ,temporary-file-directory t))) + + +(defun set-selective-display-dlw (&optional level) + "Fold text indented same of more than the cursor. +If level is set, set the indent level to LEVEL. +If 'selective-display' is already set to LEVEL, clicking +F5 again will unset 'selective-display' by setting it to 0." + (interactive "P") + (if (eq selective-display (1+ (current-column))) + (set-selective-display 0) + (set-selective-display (or level (1+ (current-column)))))) diff --git a/emacs/inits/70-global-keybinds.el b/emacs/inits/70-global-keybinds.el index 816998f..1e3657e 100644 --- a/emacs/inits/70-global-keybinds.el +++ b/emacs/inits/70-global-keybinds.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2020-10-26 17h12 EDT (hobbies)> +;; Time-stamp: <2023-08-29 09h09 CEST (anker)> (setq time-stamp-active t time-stamp-line-limit 3 @@ -45,5 +45,3 @@ (interactive "p") (if (region-active-p) (kill-region 0 0 t) (backward-kill-word arg))) - -(global-set-key (kbd "C-w") 'kill-region-or-backward-kill-word) |
