|
|
|
@ -8,7 +8,6 @@ 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.
|
|
|
|
@ -153,13 +152,7 @@ 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
|
|
|
|
|
|
|
|
|
|
(map! "<f12>" #'toggle-input-method)
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
** Font settings
|
|
|
|
@ -200,30 +193,33 @@ 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
|
|
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
|
(defun custom/doom-banner ()
|
|
|
|
|
(defun sun-position-banner ()
|
|
|
|
|
(let* (
|
|
|
|
|
(banner (with-temp-buffer
|
|
|
|
|
(insert-file-contents "~/.doom.d/banner.txt")
|
|
|
|
|
(split-string (buffer-string) "\n" t)))
|
|
|
|
|
(longest-line (apply #'max (mapcar #'length banner)))
|
|
|
|
|
)
|
|
|
|
|
(sunrise '(
|
|
|
|
|
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀"
|
|
|
|
|
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀"
|
|
|
|
|
"⠀⠀⠀⣤⣄⠀⠀⠀⠀⢾⡀⠀⠀⠸⠇⠀⠀⢀⡷⠀⠀⠀⠀⣠⣤⠀⠀⠀"
|
|
|
|
|
"⠀⠀⠀⠈⠻⣷⣄⠀⠀⠈⠁⠀⠀⣀⣀⠀⠀⠈⠁⠀⠀⣠⣾⠟⠁⠀⠀⠀"
|
|
|
|
|
"⠀⠀⠀⠀⠀⠈⠁⠀⠀⢀⣴⣾⣿⣿⣿⣿⣷⣦⡀⠀⠀⠈⠁⠀⠀⠀⠀⠀"
|
|
|
|
|
"⠀⠀⢠⣤⣀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⠀⠀⠀⣀⣤⡄⠀⠀"
|
|
|
|
|
"⠀⠀⠀⠀⠁⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠈⠀⠀⠀⠀"
|
|
|
|
|
"⢠⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⡄"
|
|
|
|
|
"⠈⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠁"))
|
|
|
|
|
(longest-line (apply #'max (mapcar #'length sunrise))))
|
|
|
|
|
(put-text-property
|
|
|
|
|
(point)
|
|
|
|
|
(dolist (line banner (point))
|
|
|
|
|
(insert
|
|
|
|
|
(+doom-dashboard--center
|
|
|
|
|
(dolist (line sunrise (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 #'custom/doom-banner)
|
|
|
|
|
(set-face-font 'doom-dashboard-banner (font-spec :family "Source Code Pro" :foundry "ADBO"))
|
|
|
|
|
(setq +doom-dashboard-ascii-banner-fn #'sun-position-banner)
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
** Line numbers
|
|
|
|
@ -247,8 +243,7 @@ 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
|
|
|
|
|
standard-indent 3)
|
|
|
|
|
tab-width 3)
|
|
|
|
|
(indent-tabs-mode)
|
|
|
|
|
(smart-tabs-mode-enable)
|
|
|
|
|
)
|
|
|
|
@ -282,8 +277,7 @@ 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
|
|
|
|
|
standard-indent 3)
|
|
|
|
|
tab-width 3)
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
*** Whitespace mode
|
|
|
|
@ -341,8 +335,7 @@ 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
|
|
|
|
|
standard-indent 3)
|
|
|
|
|
tab-width 3)
|
|
|
|
|
(indent-tabs-mode)
|
|
|
|
|
(display-line-numbers-mode)
|
|
|
|
|
)
|
|
|
|
@ -351,18 +344,6 @@ 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
|
|
|
|
@ -462,8 +443,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
|
|
|
|
@ -486,43 +467,15 @@ 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
|
|
|
|
|
:repo "leanprover/lean4-mode"
|
|
|
|
|
:files ("*.el" "data")))
|
|
|
|
|
#+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
|
|
|
|
@ -547,53 +500,35 @@ Lean 4 is still volatile and under construction.
|
|
|
|
|
|
|
|
|
|
Add the necessary hooks for LilyPond mode.
|
|
|
|
|
|
|
|
|
|
FIXME: Defer initialisation
|
|
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
|
|
|
|
|
|
(use-package! lilypond-mode
|
|
|
|
|
:mode ("\\.ly\\'" . LilyPond-mode)
|
|
|
|
|
:after-call LilyPond-mode
|
|
|
|
|
:init
|
|
|
|
|
(print! "Initializing LilyPond-mode")
|
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.ly\\'" . LilyPond-mode))
|
|
|
|
|
;:after-call LilyPond-mode
|
|
|
|
|
:config
|
|
|
|
|
(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
|
|
|
|
|
|
|
|
|
|
*** Rust
|
|
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
|
(after! rustic
|
|
|
|
|
(setq rustic-indent-offset standard-indent))
|
|
|
|
|
(add-hook 'LilyPond-mode-hook #'custom/common-program-hook)
|
|
|
|
|
)
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
** Tools
|
|
|
|
|
|
|
|
|
|
*** Language Server Protocol (LSP)
|
|
|
|
|
*** 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
|
|
|
|
|
(setq-hook! lsp-mode
|
|
|
|
|
(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)
|
|
|
|
|
)
|
|
|
|
|
))
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
*** Magit
|
|
|
|
@ -607,13 +542,25 @@ 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 ~,~.
|
|
|
|
|
|
|
|
|
@ -674,7 +621,6 @@ FIXME: Cleanup ~ein:markdown-mode-map~.
|
|
|
|
|
:desc "Move next" "L" #'ein:notebook-worksheet-move-next
|
|
|
|
|
(:prefix ("o" . "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
|
|
|
|
|