Add keybindings for ein; Drop everywhere
This commit is contained in:
parent
d1cae71134
commit
0da3fdf1b3
|
@ -1,6 +1,8 @@
|
||||||
#+TITLE: Doom Emacs Configuration File
|
#+TITLE: Doom Emacs Configuration File
|
||||||
|
|
||||||
Execute ~doom sync~ after modifying this file to tangle it to ~config.el~.
|
* Installation
|
||||||
|
|
||||||
|
Execute ~doom sync~ after modifying this file to tangle it to ~config.el~. Install `lil`
|
||||||
|
|
||||||
The following block of comments is from the default configuration.
|
The following block of comments is from the default configuration.
|
||||||
|
|
||||||
|
@ -221,7 +223,6 @@ numbers are disabled. For relative line numbers, set this to ~relative~.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq display-line-numbers-type 'relative)
|
(setq display-line-numbers-type 'relative)
|
||||||
(global-display-line-numbers-mode)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Indentation Style Hooks
|
** Indentation Style Hooks
|
||||||
|
@ -231,8 +232,8 @@ numbers are disabled. For relative line numbers, set this to ~relative~.
|
||||||
(setq
|
(setq
|
||||||
whitespace-style '(face spaces tabs newline trailing space-mark tab-mark newline-mark)
|
whitespace-style '(face spaces tabs newline trailing space-mark tab-mark newline-mark)
|
||||||
whitespace-line-column 80)
|
whitespace-line-column 80)
|
||||||
|
(display-line-numbers-mode)
|
||||||
(display-fill-column-indicator-mode)
|
(display-fill-column-indicator-mode)
|
||||||
;;(whitespace-mode)
|
|
||||||
(setq
|
(setq
|
||||||
indent-tabs-mode t
|
indent-tabs-mode t
|
||||||
indent-line-function 'tab-to-tab-stop
|
indent-line-function 'tab-to-tab-stop
|
||||||
|
@ -243,6 +244,7 @@ numbers are disabled. For relative line numbers, set this to ~relative~.
|
||||||
(defun custom/common-richtext-hook ()
|
(defun custom/common-richtext-hook ()
|
||||||
(setq whitespace-style '(face spaces tabs newline trailing space-mark tab-mark newline-mark))
|
(setq whitespace-style '(face spaces tabs newline trailing space-mark tab-mark newline-mark))
|
||||||
(setq whitespace-line-column nil)
|
(setq whitespace-line-column nil)
|
||||||
|
(display-line-numbers-mode)
|
||||||
)
|
)
|
||||||
|
|
||||||
(add-hook 'text-mode-hook #'custom/common-richtext-hook)
|
(add-hook 'text-mode-hook #'custom/common-richtext-hook)
|
||||||
|
@ -329,6 +331,7 @@ Note that ~onsave~ was intentionally turned off because it messes with version c
|
||||||
indent-line-function 'tab-to-tab-stop
|
indent-line-function 'tab-to-tab-stop
|
||||||
tab-width 3)
|
tab-width 3)
|
||||||
(indent-tabs-mode)
|
(indent-tabs-mode)
|
||||||
|
(display-line-numbers-mode)
|
||||||
)
|
)
|
||||||
(add-hook 'lisp-mode-hook #'custom/lisp-family-hook)
|
(add-hook 'lisp-mode-hook #'custom/lisp-family-hook)
|
||||||
(add-hook 'lisp-data-mode-hook #'custom/lisp-family-hook)
|
(add-hook 'lisp-data-mode-hook #'custom/lisp-family-hook)
|
||||||
|
@ -402,6 +405,9 @@ removed.
|
||||||
The target indentation style of ~LaTeX~ is as follows:
|
The target indentation style of ~LaTeX~ is as follows:
|
||||||
|
|
||||||
#+begin_src tex :tangle no
|
#+begin_src tex :tangle no
|
||||||
|
\section{A section}
|
||||||
|
% No indent here
|
||||||
|
|
||||||
\begin{enumerate}[1.]
|
\begin{enumerate}[1.]
|
||||||
\item Some item 1. Note that item is not indented.
|
\item Some item 1. Note that item is not indented.
|
||||||
|
|
||||||
|
@ -455,7 +461,7 @@ introduced.
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Lean
|
*** Lean 4
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle packages.el
|
#+begin_src emacs-lisp :tangle packages.el
|
||||||
(package! lean4-mode :recipe (
|
(package! lean4-mode :recipe (
|
||||||
|
@ -488,11 +494,14 @@ introduced.
|
||||||
|
|
||||||
Add the necessary hooks for LilyPond mode.
|
Add the necessary hooks for LilyPond mode.
|
||||||
|
|
||||||
|
FIXME: Defer initialisation
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package! lilypond-mode
|
(use-package! lilypond-mode
|
||||||
:init
|
:init
|
||||||
(print! "Initializing LilyPond-mode")
|
(print! "Initializing LilyPond-mode")
|
||||||
(add-to-list 'auto-mode-alist '("\\.ly\\'" . LilyPond-mode))
|
(add-to-list 'auto-mode-alist '("\\.ly\\'" . LilyPond-mode))
|
||||||
|
;:after-call LilyPond-mode
|
||||||
:config
|
:config
|
||||||
(add-hook 'LilyPond-mode-hook #'custom/common-program-hook)
|
(add-hook 'LilyPond-mode-hook #'custom/common-program-hook)
|
||||||
)
|
)
|
||||||
|
@ -540,15 +549,109 @@ addition. See [[https://emacs.stackexchange.com/questions/75827/doom-emacs-error
|
||||||
|
|
||||||
*** Emacs IPython Notebook (ein)
|
*** Emacs IPython Notebook (ein)
|
||||||
|
|
||||||
WIP
|
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
|
||||||
|
~ein:notebook-multilang-mode~ are minor modes and they are triggered by ~C-c~
|
||||||
|
instead of ~,~.
|
||||||
|
|
||||||
|
FIXME: Delete the emacs-esque keybinding from the maps.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
(defun custom/ein:worksheet-merge-cell-next ()
|
||||||
|
(interactive)
|
||||||
|
(ein:worksheet-merge-cell (ein:worksheet--get-ws-or-error) (ein:worksheet-get-current-cell) t t))
|
||||||
(map! :after ein
|
(map! :after ein
|
||||||
:localleader
|
:localleader
|
||||||
:map ein:notebook-mode-map
|
:map ein:notebooklist-mode-map ; Major mode
|
||||||
(:prefix ("m" . "move")
|
:desc "Reload" "r" #'ein:notebooklist-reload
|
||||||
:desc "Up" "k" #'ein-markdown-move-up
|
:desc "Open" "o" #'ein:notebooklist-open
|
||||||
:desc "Down" "j" #'ein-markdown-move-down
|
:desc "Prev item" "k" #'ein:notebooklist-prev-item
|
||||||
|
:desc "Next item" "j" #'ein:notebooklist-next-item
|
||||||
|
:desc "New notebook" "n" #'ein:notebooklist-new-notebook
|
||||||
|
:desc "New notebook with name" "N" #'ein:notebooklist-new-notebook-with-name
|
||||||
)
|
)
|
||||||
|
(map! :after ein
|
||||||
|
:localleader
|
||||||
|
:map ein:markdown-mode-map ; Major mode
|
||||||
|
:desc "Up" "K" #'ein:markdown-move-up
|
||||||
|
:desc "Down" "J" #'ein:markdown-move-down
|
||||||
|
:desc "Promote" "H" #'ein:markdown-move-up
|
||||||
|
:desc "Demote" "L" #'ein:markdown-move-down
|
||||||
|
:desc "Do" "e" #'ein:markdown-do
|
||||||
|
:desc "Cycle" "c" #'ein:markdown-cycle
|
||||||
|
)
|
||||||
|
(map! :after ein
|
||||||
|
:localleader
|
||||||
|
:map ein:traceback-mode-map ; Major mode
|
||||||
|
"RET" 'ein:tb-jump-to-source-at-point-command
|
||||||
|
"n" 'ein:tb-next-item
|
||||||
|
"p" 'ein:tb-prev-item
|
||||||
|
"q" 'bury-buffer
|
||||||
|
)
|
||||||
|
(map! :after ein
|
||||||
|
:map ein:notebook-mode-map ; Minor mode
|
||||||
|
:prefix "C-c"
|
||||||
|
;; Cell
|
||||||
|
:desc "Copy cell" "y" #'ein:worksheet-copy-cell
|
||||||
|
:desc "Yank cell" "p" #'ein:worksheet-yank-cell
|
||||||
|
:desc "kill cell" "d" #'ein:worksheet-kill-cell
|
||||||
|
:desc "Insert below" "i" #'ein:worksheet-insert-cell-below
|
||||||
|
:desc "Insert above" "I" #'ein:worksheet-insert-cell-above
|
||||||
|
:desc "Goto next input" "j" #'ein:worksheet-goto-next-input
|
||||||
|
:desc "Goto prev input" "k" #'ein:worksheet-goto-prev-input
|
||||||
|
:desc "Move cell down" "J" #'ein:worksheet-move-cell-down
|
||||||
|
:desc "Move cell up" "K" #'ein:worksheet-move-cell-up
|
||||||
|
:desc "Change cell type" "u" #'ein:worksheet-change-cell-type
|
||||||
|
:desc "Toggle output" "t" #'ein:worksheet-toggle-output
|
||||||
|
:desc "Merge cell" "C-k" #'ein:worksheet-merge-cell
|
||||||
|
:desc "Merge cell next" "C-j" #'custom/ein:worksheet-merge-cell-next
|
||||||
|
:desc "Split cell" "s" #'ein:worksheet-split-cell-at-point
|
||||||
|
:desc "Execute cell and goto next" "RET" #'ein:worksheet-execute-cell-and-goto-next
|
||||||
|
;; Output
|
||||||
|
:desc "Clear output" "C-l" #'ein:worksheet-clear-output
|
||||||
|
:desc "Clear all output" "C-S-l" #'ein:worksheet-clear-all-output
|
||||||
|
;; Notebook
|
||||||
|
:desc "Rename sheet" "R" #'ein:worksheet-rename-sheet
|
||||||
|
:desc "Move prev" "H" #'ein:notebook-worksheet-move-prev
|
||||||
|
:desc "Move next" "L" #'ein:notebook-worksheet-move-next
|
||||||
|
:desc "Rename notebook" "C-r" #'ein:notebook-rename-command
|
||||||
|
:desc "Worksheet Delete" "-" #'ein:notebook-worksheet-delete
|
||||||
|
:desc "Close notebook" "x" #'ein:notebook-close
|
||||||
|
:desc "Save notebook command" "fs" #'ein:notebook-save-notebook-command
|
||||||
|
(:prefix ("e" . "Execute")
|
||||||
|
:desc "All cells" "a" #'ein:worksheet-execute-all-cells
|
||||||
|
:desc "All cells above" "K" #'ein:worksheet-execute-all-cells-above
|
||||||
|
:desc "All cells below" "J" #'ein:worksheet-execute-all-cells-below
|
||||||
|
:desc "Cell and go to next" "RET" #'ein:worksheet-execute-cell-and-goto-next
|
||||||
|
:desc "Cell and insert below" "j" #'ein:worksheet-execute-cell-and-insert-below
|
||||||
|
)
|
||||||
|
(:prefix ("o" . "Open")
|
||||||
|
:desc "Console" "c" #'ein:console-open
|
||||||
|
:desc "Prev or last" "h" #'ein:notebook-worksheet-open-prev-or-last
|
||||||
|
:desc "Next or first" "l" #'ein:notebook-worksheet-open-next-or-first
|
||||||
|
:desc "Insert next" "n" #'ein:notebook-worksheet-insert-next
|
||||||
|
:desc "1" "1" #'ein:notebook-worksheet-open-1th
|
||||||
|
:desc "2" "2" #'ein:notebook-worksheet-open-2th
|
||||||
|
:desc "3" "3" #'ein:notebook-worksheet-open-3th
|
||||||
|
:desc "4" "4" #'ein:notebook-worksheet-open-4th
|
||||||
|
:desc "5" "5" #'ein:notebook-worksheet-open-5th
|
||||||
|
:desc "6" "6" #'ein:notebook-worksheet-open-5th
|
||||||
|
:desc "7" "7" #'ein:notebook-worksheet-open-7th
|
||||||
|
:desc "8" "8" #'ein:notebook-worksheet-open-8th
|
||||||
|
:desc "last" "9" #'ein:notebook-worksheet-open-last
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(map! :after ein-multilang
|
||||||
|
:map ein:notebook-multilang-mode-map ; Minor mode
|
||||||
|
:prefix "C-c"
|
||||||
|
:desc "Execute cell" "RET" #'ein:worksheet-execute-cell
|
||||||
|
:desc "Execute cell and goto next" "<C-return>" #'ein:worksheet-execute-cell-and-goto-next
|
||||||
|
:desc "Goto next input" "gj" 'ein:worksheet-goto-next-input
|
||||||
|
:desc "Goto prev input" "gk" 'ein:worksheet-goto-prev-input
|
||||||
|
:desc "Move cell down" "M-j" 'ein:worksheet-move-cell-down
|
||||||
|
:desc "Move cell up" "M-k" 'ein:worksheet-move-cell-up
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
|
@ -146,7 +146,7 @@
|
||||||
;;julia ; a better, faster MATLAB
|
;;julia ; a better, faster MATLAB
|
||||||
;;kotlin ; a better, slicker Java(Script)
|
;;kotlin ; a better, slicker Java(Script)
|
||||||
(latex +latexmk +lsp) ; writing papers in Emacs has never been so fun
|
(latex +latexmk +lsp) ; writing papers in Emacs has never been so fun
|
||||||
;;lean ; for folks with too much to prove
|
lean ; for folks with too much to prove
|
||||||
ledger ; be audit you can be
|
ledger ; be audit you can be
|
||||||
;;lua ; one-based indices? one-based indices
|
;;lua ; one-based indices? one-based indices
|
||||||
markdown ; writing docs for people to ignore
|
markdown ; writing docs for people to ignore
|
||||||
|
@ -184,7 +184,7 @@
|
||||||
:app
|
:app
|
||||||
calendar
|
calendar
|
||||||
emms
|
emms
|
||||||
everywhere ; *leave* Emacs!? You must be joking
|
;;everywhere ; *leave* Emacs!? You must be joking
|
||||||
;;irc ; how neckbeards socialize
|
;;irc ; how neckbeards socialize
|
||||||
;;(rss +org) ; emacs as an RSS reader
|
;;(rss +org) ; emacs as an RSS reader
|
||||||
;;twitter ; twitter client https://twitter.com/vnought
|
;;twitter ; twitter client https://twitter.com/vnought
|
||||||
|
|
Loading…
Reference in New Issue