From 0a2138a831281b75da00af8ba3c620cd2dc26526 Mon Sep 17 00:00:00 2001 From: Leni Ven Date: Sat, 25 Mar 2023 00:03:56 -0700 Subject: [PATCH 1/7] Put banner into its own file and change banner --- home/doomemacs/banner.txt | 16 ++++++++++++++++ home/doomemacs/config.org | 31 +++++++++++++------------------ 2 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 home/doomemacs/banner.txt diff --git a/home/doomemacs/banner.txt b/home/doomemacs/banner.txt new file mode 100644 index 0000000..51e43a4 --- /dev/null +++ b/home/doomemacs/banner.txt @@ -0,0 +1,16 @@ +⠀⠀⠀⠀⠂⠀⠀⠀⠂⠐⠀⡞⢡⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢂⠐ +⠀⠀⠀⠀⠁⠀⠀⠀⠀⢀⣼⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠈ +⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⡇⢤⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠁⢀⠀ +⠠⠀⠀⠀⠀⠀⠀⠀⣼⣿⠌⠀⠉⠹⡀⠀⠀⠄⠠⠀⣠⣾⣟⠡⠄⠀⠀⠀ +⠐⠀⠀⠀⠀⠀⠀⢰⣿⡿⠀⠀⠀⣠⠎⠈⠉⠙⢕⠺⣿⠟⠁⠀⠑⢎⠀⠀ +⠀⠀⠀⠀⠀⠀⡠⠋⠘⠃⢀⡶⠊⠀⠀⠀⠀⠀⠀⠱⡀⠑⢄⠀⢠⡄⠃⠀ +⠀⠀⠀⠀⠀⡜⠁⠀⠀⠀⠌⠀⠀⠀⢠⡆⠀⠀⠀⠀⢱⡀⠀⠣⣤⠇⠀⠀ +⠀⠀⠀⠀⡘⠀⠀⠀⠀⡜⠀⠀⠀⢠⣁⣇⢰⠀⠀⠀⣸⣡⠀⠀⣵⣀⠀⠀ +⠀⠀⠀⠀⡇⠀⠀⡠⠊⠃⠀⠀⢠⠃⠀⢠⠈⠀⠀⠀⠆⠀⠆⠘⢿⣿⠀⠀ +⠀⠀⠀⠀⣇⡄⠪⠄⠐⡆⠀⢠⢃⣀⣀⣘⠇⠀⠀⡜⣠⣤⣼⡀⢠⢫⢆⠀ +⠀⠀⠀⠀⢰⠀⠀⠀⡄⠹⡀⡿⠋⣿⣿⣽⠁⡠⠺⠘⣿⡿⠈⠇⡘⠣⢈⣢ +⠀⠀⠀⠀⢀⡄⠀⠀⡇⠀⠱⠸⡈⢇⡠⠹⠊⠀⠀⠀⠧⠆⣸⠘⠃⠀⣀⡀ +⠀⠀⠀⠀⡌⢀⠀⠀⢁⠀⠀⢠⣱⡔⠀⠀⠀⠀⠀⠀⠀⠀⢾⠀⠁⠀⠿⠃ +⠀⠀⢀⡜⠄⡆⠀⢀⠘⡤⠀⠀⡆⠁⠀⠀⠀⠀⠐⠀⠀⡠⠃⠀⡀⠀⠀⠀ +⠀⠀⠀⠀⠀⢃⠀⠘⢂⢀⣇⠀⣇⠀⠳⣦⠤⠄⡤⠐⠹⢇⠀⠀⡇⠀⠀⠀ +⠀⠀⠀⠀⠀⠘⠤⢇⡔⠻⣿⣆⣯⡢⣀⢸⢿⣶⡁⠀⠀⠀⠆⢸⠁⠀⠀⠀ diff --git a/home/doomemacs/config.org b/home/doomemacs/config.org index 9b07724..e2f56b8 100644 --- a/home/doomemacs/config.org +++ b/home/doomemacs/config.org @@ -198,28 +198,23 @@ available. You can either set ~doom-theme~ or manually load a theme with the ** Splash Screen #+begin_src emacs-lisp -(defun sun-position-banner () +(defun custom/doom-banner () (let* ( - (sunrise '( - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀" - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀" - "⠀⠀⠀⣤⣄⠀⠀⠀⠀⢾⡀⠀⠀⠸⠇⠀⠀⢀⡷⠀⠀⠀⠀⣠⣤⠀⠀⠀" - "⠀⠀⠀⠈⠻⣷⣄⠀⠀⠈⠁⠀⠀⣀⣀⠀⠀⠈⠁⠀⠀⣠⣾⠟⠁⠀⠀⠀" - "⠀⠀⠀⠀⠀⠈⠁⠀⠀⢀⣴⣾⣿⣿⣿⣿⣷⣦⡀⠀⠀⠈⠁⠀⠀⠀⠀⠀" - "⠀⠀⢠⣤⣀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⠀⠀⠀⣀⣤⡄⠀⠀" - "⠀⠀⠀⠀⠁⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠈⠀⠀⠀⠀" - "⢠⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⡄" - "⠈⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠁")) - (longest-line (apply #'max (mapcar #'length sunrise)))) + (banner (with-temp-buffer + (insert-file-contents "~/.doom.d/banner.txt") + (split-string (buffer-string) "\n" t))) + (longest-line (apply #'max (mapcar #'length banner))) + ) (put-text-property (point) - (dolist (line sunrise (point)) - (insert (+doom-dashboard--center - +doom-dashboard--width - (concat line (make-string (max 0 (- longest-line (length line))) 32))) - "\n")) + (dolist (line banner (point)) + (insert + (+doom-dashboard--center + +doom-dashboard--width + (concat line (make-string (max 0 (- longest-line (length line))) 32))) + "\n")) 'face 'doom-dashboard-banner))) -(setq +doom-dashboard-ascii-banner-fn #'sun-position-banner) +(setq +doom-dashboard-ascii-banner-fn #'custom/doom-banner) #+end_src ** Line numbers From e06a195b4399d7b00b9a66ae0bbc9c217d89e9a8 Mon Sep 17 00:00:00 2001 From: Leni Ven Date: Tue, 18 Apr 2023 01:50:28 -0700 Subject: [PATCH 2/7] Some cleanup and remove Magit version pin --- home/doomemacs/config.org | 109 +++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 37 deletions(-) diff --git a/home/doomemacs/config.org b/home/doomemacs/config.org index e2f56b8..2878afe 100644 --- a/home/doomemacs/config.org +++ b/home/doomemacs/config.org @@ -8,6 +8,7 @@ Dependencies: - Doom Emacs: ~git~ ~ripgrep~, ~fd-find~ - ~lilypond-mode~: ~LilyPond~ - ~:app everywhere~: ~xwininfo~, ~xdotool~, ~xclip~, ~xprop~ +- Font: Source Code Pro Individual packages may have other optional dependencies. Execute ~doom doctor~ to find out. The following block of comments is from the default configuration. @@ -152,6 +153,10 @@ Modifications to the default key bindings to mimic spacemacs (map! :leader :desc "Kill buffer and window" "b 0" #'kill-buffer-and-window) +(map! :leader + (:prefix ("S" . "Set") + :desc "Input method" "i" #'set-input-method + )) (map! :nvi "C" nil) ; remove this one weird binding #+end_src @@ -193,6 +198,7 @@ available. You can either set ~doom-theme~ or manually load a theme with the :family default-font :size default-font-size) doom-theme 'doom-lantern) +(add-to-list 'default-frame-alist '(alpha . 90)) #+end_src ** Splash Screen @@ -215,6 +221,7 @@ available. You can either set ~doom-theme~ or manually load a theme with the "\n")) 'face 'doom-dashboard-banner))) (setq +doom-dashboard-ascii-banner-fn #'custom/doom-banner) +(set-face-font 'doom-dashboard-banner (font-spec :family "Source Code Pro" :foundry "ADBO")) #+end_src ** Line numbers @@ -238,7 +245,8 @@ numbers are disabled. For relative line numbers, set this to ~relative~. (setq indent-tabs-mode t indent-line-function 'tab-to-tab-stop - tab-width 3) + tab-width 3 + standard-indent 3) (indent-tabs-mode) (smart-tabs-mode-enable) ) @@ -272,7 +280,8 @@ numbers are disabled. For relative line numbers, set this to ~relative~. (setq-default indent-tabs-mode t indent-line-function 'tab-to-tab-stop - tab-width 3) + tab-width 3 + standard-indent 3) #+end_src *** Whitespace mode @@ -330,7 +339,8 @@ Note that ~onsave~ was intentionally turned off because it messes with version c (defun custom/lisp-family-hook () (setq indent-line-function 'tab-to-tab-stop - tab-width 3) + tab-width 3 + standard-indent 3) (indent-tabs-mode) (display-line-numbers-mode) ) @@ -462,8 +472,33 @@ introduced. ) #+end_src +*** Lean 3 + +#+begin_src emacs-lisp +(add-hook! lean-mode + (activate-input-method 'Lean) + (if (not indent-tabs-mode) + (indent-tabs-mode)) + ) +(map! :after lean-mode + :localleader + :map lean-mode-map + :desc "Show symbol keystrokes" "k" #'quail-show-key + ) +(map! :after lean-mode + :map TeX-mode-map + :g "C-c C-k" nil + :g "C-c C-r" nil + :g "C-c C-s" nil + :g "C-c C-g" nil + :g "C-c SPC" nil + ) +#+end_src + *** Lean 4 +Lean 4 is still volatile and under construction. + #+begin_src emacs-lisp :tangle packages.el (package! lean4-mode :recipe ( :host github @@ -495,35 +530,46 @@ introduced. Add the necessary hooks for LilyPond mode. -FIXME: Defer initialisation - #+begin_src emacs-lisp - (use-package! lilypond-mode - :init - (print! "Initializing LilyPond-mode") - (add-to-list 'auto-mode-alist '("\\.ly\\'" . LilyPond-mode)) - ;:after-call LilyPond-mode + :mode ("\\.ly\\'" . LilyPond-mode) + :after-call LilyPond-mode :config - (add-hook 'LilyPond-mode-hook #'custom/common-program-hook) -) + (add-hook 'LilyPond-mode-hook #'custom/common-program-hook)) +(map! :after lilypond-mode + :localleader + :map LilyPond-mode-map + :desc "Info" "I" #'LilyPond-info + :desc "Info Index Search" "i" #'LilyPond-info-index-search + :desc "Comment/Uncomment" ";" #'LilyPond-comment-region + :desc "What beat" "b" #'LilyPond-what-beat + :desc "Play midi" "m" #'LilyPond-command-current-midi + :desc "Quick insert mode" "q" #'LilyPond-quick-insert-mode + :desc "Insert tag current" "t" #'LilyPond-insert-tag-current + (:prefix ("c" . "command") + :desc "Buffer" "b" #'LilyPond-command-buffer + :desc "Master" "r" #'LilyPond-command-master + :desc "LilyPond" "l" #'LilyPond-command-lilypond + :desc "Format ps" "p" #'LilyPond-command-formatps + :desc "Format midi" "m" #'LilyPond-command-formatmidi + :desc "Kill jobs" "k" #'LilyPond-kill-jobs + ) + ) #+end_src ** Tools -*** LSP +*** Language Server Protocol (LSP) File path is removed from breadcrumb since it is provided by ~doom-modeline~ and since it clutters the header-line. #+begin_src emacs-lisp -(after! lsp-mode - (print! "Configuring (after! lsp-mode ...)") - (setq - lsp-headerline-breadcrumb-enable t - lsp-headerline-breadcrumb-enable-symbol-numbers nil - lsp-headerline-breadcrumb-segments '(symbols) - )) +(setq-hook! lsp-mode + lsp-headerline-breadcrumb-enable t + lsp-headerline-breadcrumb-enable-symbol-numbers nil + lsp-headerline-breadcrumb-segments '(symbols) +) #+end_src *** Magit @@ -537,25 +583,13 @@ since it clutters the header-line. ) #+end_src -Temporarily pin the versions at 28.2 due to ~defvar-keymap~ being a Emacs 29 -addition. See [[https://emacs.stackexchange.com/questions/75827/doom-emacs-error-running-hook-global-git-commit-mode-because-void-variable][this stackexchange post]]. - -#+begin_src emacs-lisp :tangle packages.el -(package! transient - :pin "c2bdf7e12c530eb85476d3aef317eb2941ab9440" - :recipe (:host github :repo "magit/transient")) -(package! with-editor - :pin "bbc60f68ac190f02da8a100b6fb67cf1c27c53ab" - :recipe (:host github :repo "magit/with-editor")) -#+end_src - *** Emacs IPython Notebook (ein) Adapted from [[https://gist.github.com/millejoh/8632402a11384a3a0949fa350a1a271b]] Usage: Since ~ein:notebooklist-mode~, ~ein:markdown-mode~, and ~ein:traceback-mode~ are major modes, their hotkeys are triggered by the local -leader ~,~/~SPC m~. However the ~ein:notebook-mode~ and +leader ~,~ / ~SPC m~. However the ~ein:notebook-mode~ and ~ein:notebook-multilang-mode~ are minor modes and they are triggered by ~C-c~ instead of ~,~. @@ -615,11 +649,12 @@ FIXME: Cleanup ~ein:markdown-mode-map~. :desc "Move prev" "H" #'ein:notebook-worksheet-move-prev :desc "Move next" "L" #'ein:notebook-worksheet-move-next (:prefix ("o" . "Output") - :desc "Toggle output" "t" #'ein:worksheet-toggle-output-km - :desc "Clear output" "c" #'ein:worksheet-clear-output - :desc "Clear all output" "C" #'ein:worksheet-clear-all-output + :desc "Toggle output" "t" #'ein:worksheet-toggle-output-km + :desc "Show traceback" "T" #'ein:tb-show-km + :desc "Clear output" "c" #'ein:worksheet-clear-output + :desc "Clear all output" "C" #'ein:worksheet-clear-all-output :desc "Set output visibility" "v" #'ein:worksheet-set-output-visibility-all-km - :desc "Show code cell" "s" #'ein:shared-output-show-code-cell-at-point-km + :desc "Show code cell" "s" #'ein:shared-output-show-code-cell-at-point-km ) (:prefix ("e" . "Execute") :desc "All cells" "a" #'ein:worksheet-execute-all-cells From 49c07d10667cecc9af40ecf7dd5a882067433bd3 Mon Sep 17 00:00:00 2001 From: Leni Ven Date: Wed, 19 Apr 2023 10:41:24 -0700 Subject: [PATCH 3/7] Enable pass --- home/doomemacs/init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/doomemacs/init.el b/home/doomemacs/init.el index c2da5fa..e9322a8 100644 --- a/home/doomemacs/init.el +++ b/home/doomemacs/init.el @@ -98,7 +98,7 @@ (lsp +peek) ; M-x vscode magit ; a git porcelain for Emacs make ; run make tasks from Emacs - ;;pass ; password manager for nerds + pass ; password manager for nerds pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders rgb ; creating color strings From 6c8032c3e166a4c55490836892080659c77eda3c Mon Sep 17 00:00:00 2001 From: Leni Ven Date: Wed, 3 May 2023 13:31:08 -0700 Subject: [PATCH 4/7] Add Lean 4 indentation hook and IME toggle --- home/doomemacs/config.org | 6 ++++++ home/doomemacs/init.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/home/doomemacs/config.org b/home/doomemacs/config.org index 2878afe..2a11399 100644 --- a/home/doomemacs/config.org +++ b/home/doomemacs/config.org @@ -158,6 +158,8 @@ Modifications to the default key bindings to mimic spacemacs :desc "Input method" "i" #'set-input-method )) (map! :nvi "C" nil) ; remove this one weird binding + +(map! "" #'toggle-input-method) #+end_src ** Font settings @@ -504,6 +506,10 @@ Lean 4 is still volatile and under construction. :host github :repo "leanprover/lean4-mode" :files ("*.el" "data"))) +(defun custom/lean4-mode-hook () + (setq tab-width 2) + ) +(add-hook 'lean4-mode-hook #'custom/lean4-mode-hook) #+end_src #+begin_src emacs-lisp (map! :after lean4-mode diff --git a/home/doomemacs/init.el b/home/doomemacs/init.el index e9322a8..417dbce 100644 --- a/home/doomemacs/init.el +++ b/home/doomemacs/init.el @@ -17,7 +17,7 @@ (doom! :input ;;bidi ; (tfel ot) thgir etirw uoy gnipleh ;;chinese - ;;japanese + japanese ;;layout ; auie,ctsrnm is the superior home row :completion From 6bc5404df6a3f2212b056e7847e780a2c7e56ddf Mon Sep 17 00:00:00 2001 From: Leni Ven Date: Fri, 5 May 2023 21:18:21 -0700 Subject: [PATCH 5/7] Move lean4 tab width to `config.el` --- home/doomemacs/config.org | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/home/doomemacs/config.org b/home/doomemacs/config.org index 2a11399..666cda9 100644 --- a/home/doomemacs/config.org +++ b/home/doomemacs/config.org @@ -506,12 +506,11 @@ Lean 4 is still volatile and under construction. :host github :repo "leanprover/lean4-mode" :files ("*.el" "data"))) -(defun custom/lean4-mode-hook () - (setq tab-width 2) - ) -(add-hook 'lean4-mode-hook #'custom/lean4-mode-hook) #+end_src + #+begin_src emacs-lisp +(add-hook 'lean4-mode-hook (lambda () + (setq tab-width 2))) (map! :after lean4-mode :localleader :map lean4-mode-map From 625a333a25baff7f7eaf4a8a77a775d0dcf0c699 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Thu, 6 Jul 2023 20:20:13 -0700 Subject: [PATCH 6/7] Add rust hook in doomemacs; Remove C-c deletion in latex mode --- home/doomemacs/config.org | 11 +++++++++-- home/doomemacs/init.el | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/home/doomemacs/config.org b/home/doomemacs/config.org index 666cda9..444d56b 100644 --- a/home/doomemacs/config.org +++ b/home/doomemacs/config.org @@ -450,8 +450,8 @@ introduced. (add-hook 'tex-mode-hook #'custom/common-program-hook) (add-hook 'LaTeX-mode-hook #'custom/common-program-hook) (setq-default TeX-electric-sub-and-superscript nil) - (local-unset-key "C-c C-l") - (local-unset-key "C-c `") + ;(local-unset-key "C-c C-l") + ;(local-unset-key "C-c `") ) (map! :after latex :localleader @@ -562,6 +562,13 @@ Add the necessary hooks for LilyPond mode. ) #+end_src +*** Rust + +#+begin_src emacs-lisp +(after! rustic + (setq rustic-indent-offset standard-indent)) +#+end_src + ** Tools *** Language Server Protocol (LSP) diff --git a/home/doomemacs/init.el b/home/doomemacs/init.el index 417dbce..85fb8f5 100644 --- a/home/doomemacs/init.el +++ b/home/doomemacs/init.el @@ -164,7 +164,7 @@ ;;rest ; Emacs as a REST client ;;rst ; ReST in peace ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} - (rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + (rust +lsp +tree-sitter) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good ;;(scheme +guile) ; a fully conniving family of lisps sh ; she sells {ba,z,fi}sh shells on the C xor From 8f286468c8186c98251c80b42b1bdccac0ac91f7 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Sun, 13 Aug 2023 20:34:04 -0700 Subject: [PATCH 7/7] Add epub visual line hook --- home/doomemacs/config.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/home/doomemacs/config.org b/home/doomemacs/config.org index 444d56b..6f2e97e 100644 --- a/home/doomemacs/config.org +++ b/home/doomemacs/config.org @@ -351,6 +351,18 @@ Note that ~onsave~ was intentionally turned off because it messes with version c (add-hook 'emacs-lisp-mode-hook #'custom/lisp-family-hook) #+end_src +*** Epub + +#+begin_src emacs-lisp :tangle packages.el +(package! nov) +#+end_src + +#+begin_src emacs-lisp +(add-hook 'nov-mode-hook (lambda () + (setq nov-text-width t) + (visual-line-mode))) +#+end_src + *** Org Rather than using a common prefix ~, i~ like Spacemacs to consolidate all