Compare commits

..

No commits in common. "6af86b7c549615b6ce79d809f151efa37e1184a8" and "4da51b78b75752ad14a98f4d15d2feee503fcc25" have entirely different histories.

140
init.org
View file

@ -24,7 +24,6 @@ These are some packages which I might want to use in the future, or maybe not, b
create svg images to replace tokens based on regexes create svg images to replace tokens based on regexes
- https://github.com/minad/org-modern - https://github.com/minad/org-modern
maybe for em dashes? does loads more too. maybe for em dashes? does loads more too.
- https://github.com/emacsorphanage/key-chord
look at org-bullets to make a package which turns =--= and =---= into $\textemdash$ and $\textemdash$. look at org-bullets to make a package which turns =--= and =---= into $\textemdash$ and $\textemdash$.
-> https://github.com/jorgenschaefer/typoel perchance? -> https://github.com/jorgenschaefer/typoel perchance?
@ -437,52 +436,6 @@ Honestly not very happy with this at the moment, but it's kind of hacked togethe
#+end_src #+end_src
* Packages * Packages
** =general.el=
#+begin_src emacs-lisp
(defconst nemo/leader-evil "SPC")
(defconst nemo/leader-global "C-c")
(use-package general
:straight t
:config
(general-define-key
:states '(emacs normal)
:prefix-map 'nemo/leader-prefix-map
:prefix-command 'nemo/leader-prefix-command
:global-prefix nemo/leader-global
:prefix nemo/leader-evil)
(general-create-definer leader-def
:prefix-command 'nemo/leader-prefix-command
:prefix-map 'nemo/leader-prefix-map)
(general-create-definer leader-other-def
:states '(emacs normal)
:prefix-map 'nemo/leader-prefix-map
:prefix-command 'nemo/leader-prefix-command
:global-prefix nemo/leader-global
:prefix nemo/leader-evil
)
;; magit uses with-editor-mode to spawn the git process
;; in with the emacs client as the $EDITOR
(general-def '(emacs normal) 'with-editor-mode-map ",," 'with-editor-finish)
(leader-def
"<TAB>" #'nemo/switch-to-last-buffer
"d" #'duplicate-line
"gb" #'xref-go-back
"gf" #'xref-go-forward
"bk" #'switch-to-prev-buffer
"bp" #'switch-to-prev-buffer
"bj" #'switch-to-next-buffer
"bn" #'switch-to-next-buffer
"bb" #'consult-buffer
"bd" #'kill-current-buffer
"bs" #'scratch-buffer
"wd" #'delete-window
"wo" #'delete-other-windows
"ff" #'find-file
"fi" #'nemo/edit-init-org
)
)
#+end_src
** Web Search ** Web Search
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package engine-mode (use-package engine-mode
@ -517,6 +470,7 @@ Honestly not very happy with this at the moment, but it's kind of hacked togethe
#+end_src #+end_src
** =magit= ** =magit=
try out =diff-hl= for highlighting diffs in magit: try out =diff-hl= for highlighting diffs in magit:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package diff-hl (use-package diff-hl
@ -530,11 +484,6 @@ try out =diff-hl= for highlighting diffs in magit:
(use-package magit (use-package magit
:straight t :straight t
:defer t :defer t
:general
(leader-def
"gSh" 'magit-status-here
"gs" #'magit-status
"gSb" 'magit-blame)
:config :config
(setq magit-mode-quit-window 'magit-restore-window-configuration (setq magit-mode-quit-window 'magit-restore-window-configuration
;;magit-auto-revert-mode t ;;magit-auto-revert-mode t
@ -591,34 +540,50 @@ Used by Spacemacs as well.
Evil key-binds, documentation for how this works is [[https://evil.readthedocs.io/en/latest/keymaps.html][here]]: Evil key-binds, documentation for how this works is [[https://evil.readthedocs.io/en/latest/keymaps.html][here]]:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(leader-def (evil-define-key 'normal 'global (kbd "<SPC>TAB") 'mode-line-other-buffer)
"wj" 'evil-window-down (evil-define-key 'normal 'global (kbd "<SPC>bb") 'consult-buffer)
"wk" 'evil-window-up (evil-define-key 'normal 'global (kbd "<SPC>bd") 'kill-current-buffer)
"wh" 'evil-window-left (evil-define-key 'normal 'global (kbd "<SPC>ff") 'find-file)
"wl" 'evil-window-right
) (evil-define-key 'normal 'global (kbd "<SPC>fi") 'nemo/edit-init-org)
(evil-define-key 'normal 'global (kbd "<SPC>wj") 'evil-window-down)
(evil-define-key 'normal 'global (kbd "<SPC>wk") 'evil-window-up)
(evil-define-key 'normal 'global (kbd "<SPC>wh") 'evil-window-left)
(evil-define-key 'normal 'global (kbd "<SPC>wl") 'evil-window-right)
(evil-define-key '(normal visual) 'global (kbd "C-c d") 'duplicate-line)
#+end_src
I want to bind =SPC g s= to magit status, just how it is in spacemacs.
#+begin_src emacs-lisp
(evil-define-key 'normal 'global (kbd "<SPC>gs") 'magit-status)
(evil-define-key 'normal 'global (kbd "<SPC>gB") 'magit-blame)
;; (evil-define-key 'normal 'global (kbd "<SPC>gd") 'magit-diff)
#+end_src #+end_src
These bindings are somewhat different from spacemacs, which parents the insertion key binds under the major-mode prefix =m=. These bindings are somewhat different from spacemacs, which parents the insertion key binds under the major-mode prefix =m=.
With =TAB= I can cycle headings in org, and with =,,= I can exit the special source block editor. With =TAB= I can cycle headings in org, and with =,,= I can exit the special source block editor.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(leader-other-def (evil-define-key 'normal org-mode-map
:keymaps 'org-mode-map (kbd "TAB") 'org-cycle
"ih" 'org-insert-heading (kbd "RET") 'org-open-at-point
"is" 'org-insert-subheading (kbd ",,") 'org-edit-src-exit
"ii" 'org-insert-item (kbd "<SPC>ih") 'org-insert-heading
"ib" 'org-insert-structure-template (kbd "<SPC>is") 'org-insert-subheading
) (kbd "<SPC>ii") 'org-insert-item
(general-def 'normal 'org-src-mode-map ",," 'org-edit-src-exit) (kbd "<SPC>ib") 'org-insert-structure-template)
(general-def 'normal
:keymaps 'org-mode-map (evil-define-key '(normal visual) 'org-mode-map
"TAB" 'org-cycle (kbd "<SPC>il") 'org-insert-link)
"RET" 'org-open-at-point) #+end_src
(general-def '(normal visual)
:prefix nemo/leader-evil Unassociated key-bindings:
:non-normal-prefix nemo/leader-global #+begin_src emacs-lisp
:keymaps 'org-mode-map ;; for exiting out of magits commit editor with ,, instead of C-c C-c
"il" 'org-insert-link) (evil-define-key 'normal global (kbd ",,") 'with-editor-finish)
(evil-define-key 'normal 'global (kbd "<SPC>gb") 'xref-go-back)
(evil-define-key 'normal 'global (kbd "<SPC>gf") 'xref-go-forward)
#+end_src #+end_src
Close =:config=. Close =:config=.
@ -638,7 +603,6 @@ Close =:config=.
(use-package evil-collection (use-package evil-collection
:after evil :after evil
:straight t :straight t
:init (setq evil-collection-key-blacklist '("C-c <tab>"))
:config :config
(evil-collection-init)) (evil-collection-init))
#+end_src #+end_src
@ -724,7 +688,7 @@ Also use =undo-fu=, which evil can use.
:bind (("M-$" . jinx-correct) :bind (("M-$" . jinx-correct)
("C-M-$" . jinx-languages)) ("C-M-$" . jinx-languages))
:config :config
(leader-def "Ss" 'jinx-correct) (evil-define-key 'normal 'global (kbd "<SPC>Ss") 'jinx-correct)
(setq jinx-languages "en_GB dk_DK de_DE")) (setq jinx-languages "en_GB dk_DK de_DE"))
#+end_src #+end_src
@ -753,16 +717,11 @@ PDF tools for latex previewing:
:config :config
(pdf-loader-install) (pdf-loader-install)
(setq-default pdf-view-display-size 'fit-height) (setq-default pdf-view-display-size 'fit-height)
(setq pdf-view-continuous t) (setq pdf-view-continuous nil)
(setq +latex-viewers '(pdf-tools)) (setq +latex-viewers '(pdf-tools))
(leader-other-def (evil-define-key 'motion 'pdf-view-mode
:keymaps 'pdf-view-mode-map "j" 'pdf-view-next-page
"gb" 'pdf-history-backward "k" 'pdf-view-previous-page))
"gf" 'pdf-history-forward)
(general-def :keymaps 'pdf-view-mode-map
"j" (lambda() (interactive) (pdf-view-scroll-up-or-next-page 20))
"k" (lambda() (interactive) (pdf-view-scroll-down-or-previous-page 20)))
)
#+end_src #+end_src
** Org ** Org
@ -1519,7 +1478,7 @@ Shortcut for opening this file:
Dotfiles with =magit=: Dotfiles with =magit=:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun nemo/magit-dotfiles () (defun magit-dotfiles ()
"View Dotfiles repository with magit" "View Dotfiles repository with magit"
(interactive) (interactive)
(require 'magit) (require 'magit)
@ -1549,12 +1508,7 @@ Open the current file with a =sudo= tramp:
(tramp-file-name-localname vec))) (tramp-file-name-localname vec)))
(concat "/sudo:root@localhost:" (buffer-file-name)))) (concat "/sudo:root@localhost:" (buffer-file-name))))
(goto-char position))) (goto-char position)))
(leader-def "fe" 'sudo-edit-current-file) (evil-define-key 'normal 'global (kbd "<SPC>fe") 'sudo-edit-current-file)
(defun nemo/switch-to-last-buffer ()
(interactive)
(switch-to-buffer nil)
)
#+end_src #+end_src
* Keybinds * Keybinds