Merge branch 'emacs'

main
Leni Aniva 2023-08-13 20:34:31 -07:00
commit 85412a0282
3 changed files with 131 additions and 61 deletions

View File

@ -0,0 +1,16 @@
⠀⠀⠀⠀⠂⠀⠀⠀⠂⠐⠀⡞⢡⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢂⠐
⠀⠀⠀⠀⠁⠀⠀⠀⠀⢀⣼⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠋⠈
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⡇⢤⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⠟⠁⢀⠀
⠠⠀⠀⠀⠀⠀⠀⠀⣼⣿⠌⠀⠉⠹⡀⠀⠀⠄⠠⠀⣠⣾⣟⠡⠄⠀⠀⠀
⠐⠀⠀⠀⠀⠀⠀⢰⣿⡿⠀⠀⠀⣠⠎⠈⠉⠙⢕⠺⣿⠟⠁⠀⠑⢎⠀⠀
⠀⠀⠀⠀⠀⠀⡠⠋⠘⠃⢀⡶⠊⠀⠀⠀⠀⠀⠀⠱⡀⠑⢄⠀⢠⡄⠃⠀
⠀⠀⠀⠀⠀⡜⠁⠀⠀⠀⠌⠀⠀⠀⢠⡆⠀⠀⠀⠀⢱⡀⠀⠣⣤⠇⠀⠀
⠀⠀⠀⠀⡘⠀⠀⠀⠀⡜⠀⠀⠀⢠⣁⣇⢰⠀⠀⠀⣸⣡⠀⠀⣵⣀⠀⠀
⠀⠀⠀⠀⡇⠀⠀⡠⠊⠃⠀⠀⢠⠃⠀⢠⠈⠀⠀⠀⠆⠀⠆⠘⢿⣿⠀⠀
⠀⠀⠀⠀⣇⡄⠪⠄⠐⡆⠀⢠⢃⣀⣀⣘⠇⠀⠀⡜⣠⣤⣼⡀⢠⢫⢆⠀
⠀⠀⠀⠀⢰⠀⠀⠀⡄⠹⡀⡿⠋⣿⣿⣽⠁⡠⠺⠘⣿⡿⠈⠇⡘⠣⢈⣢
⠀⠀⠀⠀⢀⡄⠀⠀⡇⠀⠱⠸⡈⢇⡠⠹⠊⠀⠀⠀⠧⠆⣸⠘⠃⠀⣀⡀
⠀⠀⠀⠀⡌⢀⠀⠀⢁⠀⠀⢠⣱⡔⠀⠀⠀⠀⠀⠀⠀⠀⢾⠀⠁⠀⠿⠃
⠀⠀⢀⡜⠄⡆⠀⢀⠘⡤⠀⠀⡆⠁⠀⠀⠀⠀⠐⠀⠀⡠⠃⠀⡀⠀⠀⠀
⠀⠀⠀⠀⠀⢃⠀⠘⢂⢀⣇⠀⣇⠀⠳⣦⠤⠄⡤⠐⠹⢇⠀⠀⡇⠀⠀⠀
⠀⠀⠀⠀⠀⠘⠤⢇⡔⠻⣿⣆⣯⡢⣀⢸⢿⣶⡁⠀⠀⠀⠆⢸⠁⠀⠀⠀

View File

@ -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,7 +153,13 @@ 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
@ -193,33 +200,30 @@ 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 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)
(set-face-font 'doom-dashboard-banner (font-spec :family "Source Code Pro" :foundry "ADBO"))
#+end_src
** Line numbers
@ -243,7 +247,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)
)
@ -277,7 +282,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
@ -335,7 +341,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)
)
@ -344,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
@ -443,8 +462,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
@ -467,15 +486,43 @@ 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
@ -500,35 +547,53 @@ introduced.
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
: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
(use-package! 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)
)
(after! rustic
(setq rustic-indent-offset standard-indent))
#+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
@ -542,25 +607,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 ~,~.
@ -620,11 +673,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

View File

@ -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
@ -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
@ -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