reformatting and straight.el
This commit is contained in:
parent
d62e699d67
commit
0225ba4be3
365
init.org
365
init.org
|
@ -41,18 +41,20 @@ https://github.com/noctuid/evil-guide?tab=readme-ov-file#keymap-precedence
|
||||||
** Tangling init.org
|
** Tangling init.org
|
||||||
From Sophie's emacs.d:
|
From Sophie's emacs.d:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun tangle-init ()
|
(defun tangle-init ()
|
||||||
"If the current buffer is init.org the code-blocks are
|
"If the current buffer is init.org the code-blocks are
|
||||||
tangled, and the tangled file is compiled."
|
tangled, and the tangled file is compiled."
|
||||||
(when (equal (buffer-file-name)
|
(when (equal (buffer-file-name)
|
||||||
(expand-file-name (concat user-emacs-directory "init.org")))
|
(expand-file-name (concat user-emacs-directory "init.org")))
|
||||||
;; Avoid running hooks when tangling.
|
;; Avoid running hooks when tangling.
|
||||||
(let ((prog-mode-hook nil))
|
(let ((prog-mode-hook nil))
|
||||||
(org-babel-tangle)
|
(org-babel-tangle)
|
||||||
(byte-compile-file (concat user-emacs-directory "init.el")))))
|
(byte-compile-file (concat user-emacs-directory "init.el"))
|
||||||
|
)))
|
||||||
|
|
||||||
(add-hook 'after-save-hook 'tangle-init)
|
(add-hook 'after-save-hook 'tangle-init)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Startup performance
|
** Startup performance
|
||||||
Usually, I like to run emacs as a daemon and only ever open new emacs clients, but that often doesn't work properly and definitely doesn't work when actively working on an emacs config, so this snippet might be useful.
|
Usually, I like to run emacs as a daemon and only ever open new emacs clients, but that often doesn't work properly and definitely doesn't work when actively working on an emacs config, so this snippet might be useful.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -117,22 +119,50 @@ Backups / Auto-saves
|
||||||
Auto-save files:
|
Auto-save files:
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package auto-save-buffers-enhanced
|
(use-package auto-save-buffers-enhanced
|
||||||
:ensure t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(auto-save-buffers-enhanced t)
|
(auto-save-buffers-enhanced t)
|
||||||
(setq auto-save-buffers-enhanced-exclude-regexps '("init.org")))
|
(setq auto-save-buffers-enhanced-exclude-regexps '("init.org")))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Package repositories
|
** Package repositories
|
||||||
|
Use =straight=, and it's bootstrapping code:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'package)
|
(defvar bootstrap-version)
|
||||||
(require 'use-package)
|
(let ((bootstrap-file
|
||||||
(require 'use-package-ensure)
|
(expand-file-name
|
||||||
(setq use-package-always-ensure t)
|
"straight/repos/straight.el/bootstrap.el"
|
||||||
|
(or (bound-and-true-p straight-base-dir)
|
||||||
|
user-emacs-directory)))
|
||||||
|
(bootstrap-version 7))
|
||||||
|
(unless (file-exists-p bootstrap-file)
|
||||||
|
(with-current-buffer
|
||||||
|
(url-retrieve-synchronously
|
||||||
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
||||||
|
'silent 'inhibit-cookies)
|
||||||
|
(goto-char (point-max))
|
||||||
|
(eval-print-last-sexp)))
|
||||||
|
(load bootstrap-file nil 'nomessage))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Disable =package.el= in the early init file:
|
||||||
|
#+begin_src emacs-lisp :tangle early-init.el
|
||||||
|
(setq package-enable-at-startup nil)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Then, install =use-package= and tell it to always assume =:straight=:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(straight-use-package 'use-package)
|
||||||
|
(setq straight-use-package-by-default t)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
load org early to work around version mismatches:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(straight-use-package 'org)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Add package repositories and rank them by priority
|
Add package repositories and rank them by priority
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(setq package-archives
|
(setq package-archives
|
||||||
'(("GNU ELPA" . "https://elpa.gnu.org/packages/")
|
'(("GNU ELPA" . "https://elpa.gnu.org/packages/")
|
||||||
("MELPA" . "https://melpa.org/packages/")
|
("MELPA" . "https://melpa.org/packages/")
|
||||||
|
@ -182,7 +212,7 @@ Add package repositories and rank them by priority
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package exec-path-from-shell
|
(use-package exec-path-from-shell
|
||||||
:ensure t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(when (daemonp)
|
(when (daemonp)
|
||||||
(exec-path-from-shell-initialize)))
|
(exec-path-from-shell-initialize)))
|
||||||
|
@ -190,6 +220,7 @@ Add package repositories and rank them by priority
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package keychain-environment
|
(use-package keychain-environment
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(keychain-refresh-environment))
|
(keychain-refresh-environment))
|
||||||
|
@ -205,6 +236,7 @@ Keymap:
|
||||||
:init-value t
|
:init-value t
|
||||||
:keymap custom-bindings-map)
|
:keymap custom-bindings-map)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Visuals
|
* Visuals
|
||||||
** Borders, Frames & Windows
|
** Borders, Frames & Windows
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -215,20 +247,21 @@ Keymap:
|
||||||
(setq-default indicate-empty-lines nil)
|
(setq-default indicate-empty-lines nil)
|
||||||
(set-face-attribute 'header-line t :inherit 'default)
|
(set-face-attribute 'header-line t :inherit 'default)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Themes
|
** Themes
|
||||||
Light theme for writing
|
Light theme for writing
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package gruvbox-theme
|
(use-package gruvbox-theme
|
||||||
:ensure t)
|
:straight t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
[[https://github.com/doomemacs/themes][Doom Themes]] as default theme
|
[[https://github.com/doomemacs/themes][Doom Themes]] as default theme
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; doom needs this somehow
|
;; doom needs this somehow
|
||||||
(use-package all-the-icons
|
(use-package all-the-icons
|
||||||
:ensure t)
|
:straight t)
|
||||||
(use-package doom-themes
|
(use-package doom-themes
|
||||||
:ensure t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(setq doom-themes-enable-bold t
|
(setq doom-themes-enable-bold t
|
||||||
doom-themes-enable-italic t)
|
doom-themes-enable-italic t)
|
||||||
|
@ -260,6 +293,7 @@ Helper function for switching themes.
|
||||||
(interactive)
|
(interactive)
|
||||||
(load-theme nemo/dark-theme t))
|
(load-theme nemo/dark-theme t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Fonts
|
** Fonts
|
||||||
Font size [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html][(height)]] in emacs works in $\frac{1}{10}$ths of points, so ~110~ is the same as ~11~ points.
|
Font size [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html][(height)]] in emacs works in $\frac{1}{10}$ths of points, so ~110~ is the same as ~11~ points.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -282,9 +316,11 @@ Font size [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attri
|
||||||
|
|
||||||
Use nerd-icons and apple emojis
|
Use nerd-icons and apple emojis
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package nerd-icons)
|
(use-package nerd-icons
|
||||||
|
:straight t)
|
||||||
|
|
||||||
(use-package emojify
|
(use-package emojify
|
||||||
|
:straight t
|
||||||
:config
|
:config
|
||||||
(when (member "Apple Color Emoji" (font-family-list))
|
(when (member "Apple Color Emoji" (font-family-list))
|
||||||
(set-fontset-font t 'symbol (font-spec :family "Apple Color Emoji") nil 'prepend)))
|
(set-fontset-font t 'symbol (font-spec :family "Apple Color Emoji") nil 'prepend)))
|
||||||
|
@ -293,10 +329,12 @@ Use nerd-icons and apple emojis
|
||||||
Use both fixed and variable pitched fonts and faces.
|
Use both fixed and variable pitched fonts and faces.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package mixed-pitch
|
(use-package mixed-pitch
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:hook ((org-mode . mixed-pitch-mode)
|
:hook ((org-mode . mixed-pitch-mode)
|
||||||
(LaTeX-mode . mixed-pitch-mode)))
|
(LaTeX-mode . mixed-pitch-mode)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Mode Line
|
** Mode Line
|
||||||
Honestly not very happy with this at the moment, but it's kind of hacked together based on Sophie's and Amit's modelines.
|
Honestly not very happy with this at the moment, but it's kind of hacked together based on Sophie's and Amit's modelines.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -392,10 +430,12 @@ Honestly not very happy with this at the moment, but it's kind of hacked togethe
|
||||||
:inherit 'mode-line-position-face
|
:inherit 'mode-line-position-face
|
||||||
:foreground "black" :background "#eab700")
|
:foreground "black" :background "#eab700")
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Packages
|
* Packages
|
||||||
** Web Search
|
** Web Search
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package engine-mode
|
(use-package engine-mode
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(defengine duckduckgo
|
(defengine duckduckgo
|
||||||
|
@ -424,11 +464,13 @@ Honestly not very happy with this at the moment, but it's kind of hacked togethe
|
||||||
(engine-mode t)
|
(engine-mode t)
|
||||||
)
|
)
|
||||||
#+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
|
||||||
|
:straight t
|
||||||
:config
|
:config
|
||||||
(global-diff-hl-mode))
|
(global-diff-hl-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
@ -436,6 +478,7 @@ try out =diff-hl= for highlighting diffs in magit:
|
||||||
=magit= is awesome and the number one reason why I use Emacs!
|
=magit= is awesome and the number one reason why I use Emacs!
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package magit
|
(use-package magit
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(setq magit-mode-quit-window 'magit-restore-window-configuration
|
(setq magit-mode-quit-window 'magit-restore-window-configuration
|
||||||
|
@ -447,6 +490,7 @@ try out =diff-hl= for highlighting diffs in magit:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package magit-todos
|
(use-package magit-todos
|
||||||
:after magit
|
:after magit
|
||||||
|
:straight t
|
||||||
:config
|
:config
|
||||||
(magit-todos-mode t))
|
(magit-todos-mode t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
@ -454,6 +498,7 @@ try out =diff-hl= for highlighting diffs in magit:
|
||||||
And forge sounds cool as well.
|
And forge sounds cool as well.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package forge
|
(use-package forge
|
||||||
|
:straight t
|
||||||
:after magit)
|
:after magit)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
@ -461,22 +506,25 @@ And forge sounds cool as well.
|
||||||
This is one of those features of Spacemacs that is super useful.
|
This is one of those features of Spacemacs that is super useful.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
|
:straight t
|
||||||
:config
|
:config
|
||||||
(which-key-mode))
|
(which-key-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** rainbow-delimiters
|
** rainbow-delimiters
|
||||||
raimbow delimiters colours matching delimiters with different colours.
|
raimbow delimiters colours matching delimiters with different colours.
|
||||||
Used by Spacemacs as well.
|
Used by Spacemacs as well.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package rainbow-delimiters
|
(use-package rainbow-delimiters
|
||||||
|
:straight t
|
||||||
:hook (prog-mode . rainbow-delimiters-mode))
|
:hook (prog-mode . rainbow-delimiters-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** evil
|
** evil
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil
|
(use-package evil
|
||||||
:ensure t
|
:straight t
|
||||||
:init
|
:init
|
||||||
(setq evil-want-C-u-scroll t)
|
(setq evil-want-C-u-scroll t)
|
||||||
(setq evil-want-keybinding nil)
|
(setq evil-want-keybinding nil)
|
||||||
|
@ -485,7 +533,7 @@ Used by Spacemacs as well.
|
||||||
(evil-mode 1)
|
(evil-mode 1)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Evil key-binds:
|
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
|
||||||
(evil-global-set-key 'normal (kbd "<SPC>TAB") 'mode-line-other-buffer)
|
(evil-global-set-key 'normal (kbd "<SPC>TAB") 'mode-line-other-buffer)
|
||||||
(evil-define-key 'normal 'global (kbd "<SPC>bb") 'consult-buffer)
|
(evil-define-key 'normal 'global (kbd "<SPC>bb") 'consult-buffer)
|
||||||
|
@ -506,13 +554,17 @@ I want to bind =SPC g s= to magit status, just how it is in spacemacs.
|
||||||
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
|
||||||
(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle)
|
(evil-define-key 'normal org-mode-map
|
||||||
(evil-define-key 'normal 'org-mode-map (kbd ",,") 'org-edit-src-exit)
|
(kbd "TAB") 'org-cycle
|
||||||
(evil-define-key 'normal 'org-mode-map (kbd "<SPC>ih") 'org-insert-heading)
|
(kbd "RET") 'org-open-at-point
|
||||||
(evil-define-key 'normal 'org-mode-map (kbd "<SPC>is") 'org-insert-subheading)
|
(kbd ",,") 'org-edit-src-exit
|
||||||
(evil-define-key 'normal 'org-mode-map (kbd "<SPC>ii") 'org-insert-item)
|
(kbd "<SPC>ih") 'org-insert-heading
|
||||||
(evil-define-key 'normal 'org-mode-map (kbd "<SPC>ib") 'org-insert-structure-template)
|
(kbd "<SPC>is") 'org-insert-subheading
|
||||||
(evil-define-key '(normal visual) 'org-mode-map (kbd "<SPC>il") 'org-insert-link)
|
(kbd "<SPC>ii") 'org-insert-item
|
||||||
|
(kbd "<SPC>ib") 'org-insert-structure-template)
|
||||||
|
|
||||||
|
(evil-define-key '(normal visual) 'org-mode-map
|
||||||
|
(kbd "<SPC>il") 'org-insert-link)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Unassociated key-bindings:
|
Unassociated key-bindings:
|
||||||
|
@ -529,6 +581,7 @@ Close =:config=.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-surround
|
(use-package evil-surround
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(global-evil-surround-mode 1))
|
(global-evil-surround-mode 1))
|
||||||
|
@ -537,7 +590,7 @@ Close =:config=.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package evil-collection
|
(use-package evil-collection
|
||||||
:after evil
|
:after evil
|
||||||
:ensure t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(evil-collection-init))
|
(evil-collection-init))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
@ -546,12 +599,14 @@ Close =:config=.
|
||||||
Also use =undo-fu=, which evil can use.
|
Also use =undo-fu=, which evil can use.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package undo-fu
|
(use-package undo-fu
|
||||||
|
:straight t
|
||||||
:defer t)
|
:defer t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Projectile
|
** Projectile
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(setq projectile-project-search-path '("~/code/"))
|
(setq projectile-project-search-path '("~/code/"))
|
||||||
|
@ -561,19 +616,22 @@ Also use =undo-fu=, which evil can use.
|
||||||
** =ripgrep= & Co.
|
** =ripgrep= & Co.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ripgrep
|
(use-package ripgrep
|
||||||
|
:straight t
|
||||||
:defer t)
|
:defer t)
|
||||||
|
|
||||||
(use-package rg
|
(use-package rg
|
||||||
|
:straight t
|
||||||
:defer t)
|
:defer t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** VTerm
|
** VTerm
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package vterm
|
(use-package vterm
|
||||||
:ensure t)
|
:straight t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Stuff
|
* Stuff
|
||||||
** Minibuffer escape
|
** Mini-buffer escape
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(setq minibuffer-prompt-properties
|
(setq minibuffer-prompt-properties
|
||||||
'(read-only t
|
'(read-only t
|
||||||
|
@ -592,10 +650,12 @@ Also use =undo-fu=, which evil can use.
|
||||||
|
|
||||||
(global-set-key (kbd "<escape>") 'nemo/abort-minibuffer-if-active)
|
(global-set-key (kbd "<escape>") 'nemo/abort-minibuffer-if-active)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Writing
|
* Writing
|
||||||
** Olivetti
|
** Olivetti
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package olivetti
|
(use-package olivetti
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
; :bind (:map custom-bindings-map ("C-c o" . olivetti-mode))
|
; :bind (:map custom-bindings-map ("C-c o" . olivetti-mode))
|
||||||
:config
|
:config
|
||||||
|
@ -603,9 +663,11 @@ Also use =undo-fu=, which evil can use.
|
||||||
|
|
||||||
(add-hook 'olivetti-mode-on-hook (lambda () (olivetti-set-width 88)))
|
(add-hook 'olivetti-mode-on-hook (lambda () (olivetti-set-width 88)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Spelling
|
** Spelling
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package jinx
|
(use-package jinx
|
||||||
|
:straight t
|
||||||
:hook (emacs-startup . global-jinx-mode)
|
:hook (emacs-startup . global-jinx-mode)
|
||||||
:bind (("M-$" . jinx-correct)
|
:bind (("M-$" . jinx-correct)
|
||||||
("C-M-$" . jinx-languages))
|
("C-M-$" . jinx-languages))
|
||||||
|
@ -613,33 +675,48 @@ Also use =undo-fu=, which evil can use.
|
||||||
(evil-define-key 'normal 'global (kbd "<SPC>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
|
||||||
|
|
||||||
** LaTeX
|
** LaTeX
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package auctex
|
(use-package auctex
|
||||||
|
:straight t
|
||||||
:hook
|
:hook
|
||||||
(LaTeX-mode . turn-on-prettify-symbols-mode)
|
(LaTeX-mode . turn-on-prettify-symbols-mode)
|
||||||
(LaTeX-mode . reftex-mode)
|
(LaTeX-mode . reftex-mode)
|
||||||
; (LaTeX-mode . (lambda () (corfu-mode -1)))
|
;; (LaTeX-mode . (lambda () (corfu-mode -1)))
|
||||||
; (LaTeX-mode . outline-minor-mode)
|
;; (LaTeX-mode . outline-minor-mode)
|
||||||
(LaTeX-mode . olivetti-mode)
|
(LaTeX-mode . olivetti-mode)
|
||||||
)
|
:config
|
||||||
|
(setq TeX-view-program-selection '((output-pdf "PDF Tools"))
|
||||||
|
TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view))
|
||||||
|
TeX-source-correlate-start-server t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
PDF tools for latex previewing
|
PDF tools for latex previewing:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package pdf-tools
|
(use-package pdf-tools
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:init (pdf-loader-install))
|
:mode ("\\.pdf\\'" . pdf-view-mode)
|
||||||
|
:config
|
||||||
|
(pdf-loader-install)
|
||||||
|
(setq-default pdf-view-display-size 'fit-height)
|
||||||
|
(setq pdf-view-continuous nil)
|
||||||
|
(setq +latex-viewers '(pdf-tools))
|
||||||
|
(evil-define-key 'motion 'pdf-view-mode
|
||||||
|
"j" 'pdf-view-next-page
|
||||||
|
"k" 'pdf-view-previous-page))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Org
|
** Org
|
||||||
Taken from [[https://sophiebos.io/posts/prettifying-emacs-org-mode/][ here]].
|
Taken from [[https://sophiebos.io/posts/prettifying-emacs-org-mode/][ here]].
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org
|
(use-package org
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:hook (org-mode . olivetti-mode)
|
:hook (org-mode . olivetti-mode)
|
||||||
:hook (org-mode . variable-pitch-mode)
|
:hook (org-mode . variable-pitch-mode)
|
||||||
; I basically always want to be running =visual-line-mode= anyway, but certainly in org-mode.
|
;; I basically always want to be running =visual-line-mode= anyway, but certainly in org-mode.
|
||||||
:hook (org-mode . visual-line-mode)
|
:hook (org-mode . visual-line-mode)
|
||||||
:hook (org-mode . nemo/prettify-symbols-setup)
|
:hook (org-mode . nemo/prettify-symbols-setup)
|
||||||
:config
|
:config
|
||||||
|
@ -647,7 +724,7 @@ Taken from [[https://sophiebos.io/posts/prettifying-emacs-org-mode/][ here]].
|
||||||
|
|
||||||
Change heading font sizes:
|
Change heading font sizes:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(custom-set-faces
|
(custom-set-faces
|
||||||
'(org-document-title ((t (:height 1.8))))
|
'(org-document-title ((t (:height 1.8))))
|
||||||
'(outline-1 ((t (:height 1.35))))
|
'(outline-1 ((t (:height 1.35))))
|
||||||
'(outline-2 ((t (:height 1.3))))
|
'(outline-2 ((t (:height 1.3))))
|
||||||
|
@ -666,23 +743,23 @@ Open Org files with the content folded away:
|
||||||
|
|
||||||
Enable LaTeX previews.
|
Enable LaTeX previews.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq org-startup-with-latex-preview t)
|
(setq org-startup-with-latex-preview t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Inline images as well.
|
Inline images as well.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq org-startup-with-inline-images t)
|
(setq org-startup-with-inline-images t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
In case LaTeX previews are too small, use this to increase them.
|
In case LaTeX previews are too small, use this to increase them.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(plist-put org-format-latex-options :scale 1.35)
|
(plist-put org-format-latex-options :scale 1.35)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
==pretty-entities= allows for latex symbols to be embedded into org-mode.
|
==pretty-entities= allows for latex symbols to be embedded into org-mode.
|
||||||
=org-hide-leading-stars= hides all but one star on org headings.
|
=org-hide-leading-stars= hides all but one star on org headings.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq org-adapt-indentation t
|
(setq org-adapt-indentation t
|
||||||
org-hide-leading-stars t
|
org-hide-leading-stars t
|
||||||
org-pretty-entities-include-sub-superscripts t
|
org-pretty-entities-include-sub-superscripts t
|
||||||
org-pretty-entities t)
|
org-pretty-entities t)
|
||||||
|
@ -690,40 +767,43 @@ In case LaTeX previews are too small, use this to increase them.
|
||||||
|
|
||||||
Let emacs act according to the language's rules inside of a source block.
|
Let emacs act according to the language's rules inside of a source block.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq org-src-fontify-natively t
|
(setq org-src-fontify-natively t
|
||||||
org-src-tab-acts-natively t
|
org-src-tab-acts-natively t
|
||||||
org-edit-src-content-indentation 0)
|
org-edit-src-content-indentation 0)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
End =:config=
|
End =:config=
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Use org-bullets for fancy headline markers
|
Use org-bullets for fancy headline markers
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package org-bullets
|
(use-package org-bullets
|
||||||
|
:straight t
|
||||||
:hook (org-mode . (lambda () (org-bullets-mode 1)))
|
:hook (org-mode . (lambda () (org-bullets-mode 1)))
|
||||||
:config)
|
:config)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Use typo-mode in org-mode for en and em dashes:
|
Use typo-mode in org-mode for en and em dashes:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(require 'typo)
|
(require 'typo)
|
||||||
|
|
||||||
(typo-global-mode 1)
|
(typo-global-mode 1)
|
||||||
(add-hook 'org-mode-hook 'typo-mode)
|
(add-hook 'org-mode-hook 'typo-mode)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Use =org-fragtog= to show embedded LaTeX fragments when in insert mode.
|
Use =org-fragtog= to show embedded LaTeX fragments when in insert mode.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-fragtog
|
(use-package org-fragtog
|
||||||
|
:straight t
|
||||||
:hook (org-mode . org-fragtog-mode))
|
:hook (org-mode . org-fragtog-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Using =org-appear= we can hide emphasis markers for italic, bold, etc. and show when editing the surrounded word.
|
Using =org-appear= we can hide emphasis markers for italic, bold, etc. and show when editing the surrounded word.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-appear
|
(use-package org-appear
|
||||||
|
:straight t
|
||||||
:commands (org-appear-mode)
|
:commands (org-appear-mode)
|
||||||
:hook (org-mode . org-appear-mode)
|
:hook (org-mode . org-appear-mode)
|
||||||
:config
|
:config
|
||||||
|
@ -734,7 +814,8 @@ Using =org-appear= we can hide emphasis markers for italic, bold, etc. and show
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org-modern
|
(use-package org-modern
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:after org
|
:after org
|
||||||
:hook (org-mode . org-modern-mode))
|
:hook (org-mode . org-modern-mode))
|
||||||
|
@ -742,9 +823,9 @@ Using =org-appear= we can hide emphasis markers for italic, bold, etc. and show
|
||||||
|
|
||||||
Change org face fonts and font sizes for headers.
|
Change org face fonts and font sizes for headers.
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(require 'org-faces)
|
(require 'org-faces)
|
||||||
;; size org levels differently
|
;; size org levels differently
|
||||||
(dolist (face '((org-document-title . 1.8)
|
(dolist (face '((org-document-title . 1.8)
|
||||||
(org-level-1 . 1.35)
|
(org-level-1 . 1.35)
|
||||||
(org-level-2 . 1.3)
|
(org-level-2 . 1.3)
|
||||||
(org-level-3 . 1.2)
|
(org-level-3 . 1.2)
|
||||||
|
@ -764,24 +845,24 @@ Change org face fonts and font sizes for headers.
|
||||||
|
|
||||||
Fix org-indent to be fixed-pitch.
|
Fix org-indent to be fixed-pitch.
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(require 'org-indent)
|
(require 'org-indent)
|
||||||
(set-face-attribute 'org-indent nil :inherit '(org-hide fixed-pitch))
|
(set-face-attribute 'org-indent nil :inherit '(org-hide fixed-pitch))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Make sure that faces like code blocks or verbatim text are still using a monospaced font:
|
Make sure that faces like code blocks or verbatim text are still using a monospaced font:
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch :height 0.85)
|
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch :height 0.85)
|
||||||
(set-face-attribute 'org-code nil :foreground nil :inherit '(shadow fixed-pitch) :height 0.85)
|
(set-face-attribute 'org-code nil :foreground nil :inherit '(shadow fixed-pitch) :height 0.85)
|
||||||
(set-face-attribute 'org-indent nil :foreground nil :inherit '(org-hide fixed-pitch) :height 0.85)
|
(set-face-attribute 'org-indent nil :foreground nil :inherit '(org-hide fixed-pitch) :height 0.85)
|
||||||
(set-face-attribute 'org-verbatim nil :foreground nil :inherit '(shadow fixed-pitch) :height 0.85)
|
(set-face-attribute 'org-verbatim nil :foreground nil :inherit '(shadow fixed-pitch) :height 0.85)
|
||||||
(set-face-attribute 'org-special-keyword nil :foreground nil :inherit '(font-lock-comment-face fixed-pitch))
|
(set-face-attribute 'org-special-keyword nil :foreground nil :inherit '(font-lock-comment-face fixed-pitch))
|
||||||
(set-face-attribute 'org-meta-line nil :foreground nil :inherit '(font-lock-comment-face fixed-pitch))
|
(set-face-attribute 'org-meta-line nil :foreground nil :inherit '(font-lock-comment-face fixed-pitch))
|
||||||
(set-face-attribute 'org-checkbox nil :foreground nil :inherit 'fixed-pitch)
|
(set-face-attribute 'org-checkbox nil :foreground nil :inherit 'fixed-pitch)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
prettify symbols for quotes and source blocks in org-mode.
|
prettify symbols for quotes and source blocks in org-mode.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun nemo/prettify-symbols-setup ()
|
(defun nemo/prettify-symbols-setup ()
|
||||||
;; org-babel
|
;; org-babel
|
||||||
(push '("#+BEGIN_SRC" . ?≫) prettify-symbols-alist)
|
(push '("#+BEGIN_SRC" . ?≫) prettify-symbols-alist)
|
||||||
(push '("#+END_SRC" . ?≫) prettify-symbols-alist)
|
(push '("#+END_SRC" . ?≫) prettify-symbols-alist)
|
||||||
|
@ -796,41 +877,45 @@ prettify symbols for quotes and source blocks in org-mode.
|
||||||
|
|
||||||
=svg-tags-mode= for fancy SVG images
|
=svg-tags-mode= for fancy SVG images
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package svg-tag-mode
|
(use-package svg-tag-mode
|
||||||
|
:straight t
|
||||||
:config
|
:config
|
||||||
(setq svg-tag-tags
|
(setq svg-tag-tags
|
||||||
'((":TODO:" . ((lambda (tag) (svg-tag-make "TODO"))))))
|
'((":TODO:" . ((lambda (tag) (svg-tag-make "TODO"))))))
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Agenda
|
** org-agenda
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'org)
|
(require 'org)
|
||||||
|
|
||||||
(setq org-agenda-start-on-weekday nil
|
(setq org-agenda-start-on-weekday nil
|
||||||
org-agenda-block-separator nil
|
org-agenda-block-separator nil
|
||||||
org-agenda-remove-tags t)
|
org-agenda-remove-tags t)
|
||||||
|
|
||||||
(use-package org-super-agenda
|
(use-package org-super-agenda
|
||||||
|
:straight t
|
||||||
:after org
|
:after org
|
||||||
:config
|
:config
|
||||||
(org-super-agenda-mode))
|
(org-super-agenda-mode))
|
||||||
|
|
||||||
(setq org-agenda-files (list "~/Shared/agenda.org"
|
(setq org-agenda-files (list "~/Shared/agenda.org"
|
||||||
"~/notes.org"
|
"~/notes.org"
|
||||||
"~/projects.org"))
|
"~/projects.org"))
|
||||||
|
|
||||||
(add-hook 'emacs-startup-hook
|
(add-hook 'emacs-startup-hook
|
||||||
(lambda () (progn (org-agenda nil "a")
|
(lambda () (progn (org-agenda nil "a")
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(olivetti-mode))))
|
(olivetti-mode))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Navigation / mini-buffer
|
* Navigation / mini-buffer
|
||||||
Realistically, I will probably never use 90% of Helm's functionality, so =vertico= should be sufficient.
|
Realistically, I will probably never use 90% of Helm's functionality, so =vertico= should be sufficient.
|
||||||
** Move Text
|
** Move Text
|
||||||
Use the =move-text= package to move the current line or selection up or down with =M-j= and =M-k=.
|
Use the =move-text= package to move the current line or selection up or down with =M-j= and =M-k=.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package move-text
|
(use-package move-text
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:bind (("M-j" . move-text-down)
|
:bind (("M-j" . move-text-down)
|
||||||
("M-k" . move-text-up)))
|
("M-k" . move-text-up)))
|
||||||
|
@ -839,6 +924,7 @@ Use the =move-text= package to move the current line or selection up or down wit
|
||||||
** Treemacs
|
** Treemacs
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package treemacs
|
(use-package treemacs
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
;; hijack projectile prefix because they fit together
|
;; hijack projectile prefix because they fit together
|
||||||
:bind (("C-x p t" . treemacs))
|
:bind (("C-x p t" . treemacs))
|
||||||
|
@ -847,23 +933,25 @@ Use the =move-text= package to move the current line or selection up or down wit
|
||||||
|
|
||||||
(use-package treemacs-evil
|
(use-package treemacs-evil
|
||||||
:after (treemacs evil)
|
:after (treemacs evil)
|
||||||
:ensure t)
|
:straight t)
|
||||||
|
|
||||||
(use-package treemacs-projectile
|
(use-package treemacs-projectile
|
||||||
:after (treemacs projectile)
|
:after (treemacs projectile)
|
||||||
:ensure t)
|
:straight t)
|
||||||
|
|
||||||
(use-package treemacs-icons-dired
|
(use-package treemacs-icons-dired
|
||||||
:hook (dired-mode . treemacs-icons-dired-enable-once)
|
:hook (dired-mode . treemacs-icons-dired-enable-once)
|
||||||
:ensure t)
|
:straight t)
|
||||||
|
|
||||||
(use-package treemacs-magit
|
(use-package treemacs-magit
|
||||||
:after (treemacs magit)
|
:after (treemacs magit)
|
||||||
:ensure t)
|
:straight t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Vertico
|
** Vertico
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package vertico
|
(use-package vertico
|
||||||
|
:straight t
|
||||||
:bind (:map minibuffer-local-map
|
:bind (:map minibuffer-local-map
|
||||||
("C-h" . backward-kill-sexp))
|
("C-h" . backward-kill-sexp))
|
||||||
:config
|
:config
|
||||||
|
@ -879,6 +967,7 @@ Use the =move-text= package to move the current line or selection up or down wit
|
||||||
Use =vertico-posframe= to make the =vertico= buffer floating in the centre of the frame.
|
Use =vertico-posframe= to make the =vertico= buffer floating in the centre of the frame.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package vertico-posframe
|
(use-package vertico-posframe
|
||||||
|
:straight t
|
||||||
:config
|
:config
|
||||||
(vertico-posframe-mode 1)
|
(vertico-posframe-mode 1)
|
||||||
(setq vertico-posframe-height vertico-count
|
(setq vertico-posframe-height vertico-count
|
||||||
|
@ -889,12 +978,15 @@ Use =vertico-posframe= to make the =vertico= buffer floating in the centre of th
|
||||||
(t posframe))
|
(t posframe))
|
||||||
))
|
))
|
||||||
|
|
||||||
(use-package savehist :init (savehist-mode))
|
(use-package savehist
|
||||||
|
:straight t
|
||||||
|
:init (savehist-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Use =consult-xref= for =lsp-xref= and =xref-find-references=.
|
Use =consult-xref= for =lsp-xref= and =xref-find-references=.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package consult
|
(use-package consult
|
||||||
|
:straight t
|
||||||
:bind (:map custom-bindings-map
|
:bind (:map custom-bindings-map
|
||||||
("C-x b" . consult-buffer)
|
("C-x b" . consult-buffer)
|
||||||
("M-g g" . consult-goto-line))
|
("M-g g" . consult-goto-line))
|
||||||
|
@ -907,7 +999,8 @@ Use =consult-xref= for =lsp-xref= and =xref-find-references=.
|
||||||
|
|
||||||
[[https://github.com/minad/marginalia][=marginalia=]] adds marginalia into the mini-buffer, for example key-binds in =M-x=
|
[[https://github.com/minad/marginalia][=marginalia=]] adds marginalia into the mini-buffer, for example key-binds in =M-x=
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package marginalia
|
(use-package marginalia
|
||||||
|
:straight t
|
||||||
:init
|
:init
|
||||||
(marginalia-mode 1))
|
(marginalia-mode 1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
@ -915,6 +1008,7 @@ Use =consult-xref= for =lsp-xref= and =xref-find-references=.
|
||||||
Auto-completion using =corfu=:
|
Auto-completion using =corfu=:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package corfu
|
(use-package corfu
|
||||||
|
:straight t
|
||||||
:custom
|
:custom
|
||||||
;; Enable auto completion
|
;; Enable auto completion
|
||||||
(corfu-auto t)
|
(corfu-auto t)
|
||||||
|
@ -931,6 +1025,15 @@ Auto-completion using =corfu=:
|
||||||
:init
|
:init
|
||||||
(global-corfu-mode))
|
(global-corfu-mode))
|
||||||
|
|
||||||
|
(use-package corfu-terminal
|
||||||
|
:straight t
|
||||||
|
:defer t
|
||||||
|
:hook (before-make-frame .
|
||||||
|
(lambda ()
|
||||||
|
(corfu-terminal-mode
|
||||||
|
(if (display-graphic-p) -1 +1))))
|
||||||
|
)
|
||||||
|
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
:custom
|
:custom
|
||||||
;; TODO
|
;; TODO
|
||||||
|
@ -951,9 +1054,36 @@ Auto-completion using =corfu=:
|
||||||
(setq tab-always-indent 'complete))
|
(setq tab-always-indent 'complete))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Use =kind-icon= to decorate corfu completion candidates:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package kind-icon
|
||||||
|
:straight t
|
||||||
|
:after corfu
|
||||||
|
:config
|
||||||
|
(add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Use =prescient= to sort completion candidates:
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
|
(use-package prescient
|
||||||
|
:straight t
|
||||||
|
:after corfu
|
||||||
|
:defer t
|
||||||
|
:config
|
||||||
|
(add-to-list 'prescient-filter-method 'fuzzy))
|
||||||
|
|
||||||
|
(use-package corfu-prescient
|
||||||
|
:straight t
|
||||||
|
:after corfu
|
||||||
|
:straight t
|
||||||
|
:config
|
||||||
|
(corfu-prescient-mode 1))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
This package seems to slow down search quite a bit in common buffers like find-file and exectue-extended-comand:
|
This package seems to slow down search quite a bit in common buffers like find-file and exectue-extended-comand:
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package cape
|
(use-package cape
|
||||||
|
:straight t
|
||||||
;; Bind dedicated completion commands
|
;; Bind dedicated completion commands
|
||||||
;; Alternative prefix keys: C-c p, M-p, M-+, ...
|
;; Alternative prefix keys: C-c p, M-p, M-+, ...
|
||||||
:bind (("C-c p p" . completion-at-point) ;; capf
|
:bind (("C-c p p" . completion-at-point) ;; capf
|
||||||
|
@ -991,8 +1121,8 @@ This package seems to slow down search quite a bit in common buffers like find-f
|
||||||
|
|
||||||
Fuzzy and out-of-order completion matching using =orderless=:
|
Fuzzy and out-of-order completion matching using =orderless=:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package orderless
|
(use-package orderless
|
||||||
:ensure t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(setq completion-styles '(orderless basic partial-completion)
|
(setq completion-styles '(orderless basic partial-completion)
|
||||||
orderless-matching-styles '(orderless-flex)
|
orderless-matching-styles '(orderless-flex)
|
||||||
|
@ -1003,49 +1133,60 @@ Fuzzy and out-of-order completion matching using =orderless=:
|
||||||
Use =embark= for in-mini-buffer actions:
|
Use =embark= for in-mini-buffer actions:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package embark
|
(use-package embark
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:bind (("C-." . embark-act))
|
:bind (("C-." . embark-act))
|
||||||
:config
|
:config
|
||||||
())
|
())
|
||||||
|
|
||||||
(use-package embark-consult
|
(use-package embark-consult
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:hook (embark-collect-mode . consult-preview-at-point-mode))
|
:hook (embark-collect-mode . consult-preview-at-point-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun my-consult-line-wrapper ()
|
(defun my-consult-line-wrapper ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(vertico-posframe-mode -1)
|
(vertico-posframe-mode -1)
|
||||||
(consult-line)
|
(consult-line)
|
||||||
(vertico-posframe-mode 1))
|
(vertico-posframe-mode 1))
|
||||||
|
|
||||||
(defun my-consult-ripgrep-wrapper ()
|
(defun my-consult-ripgrep-wrapper ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(vertico-posframe-mode -1)
|
(vertico-posframe-mode -1)
|
||||||
(consult-ripgrep)
|
(consult-ripgrep)
|
||||||
(vertico-posframe-mode 1))
|
(vertico-posframe-mode 1))
|
||||||
|
|
||||||
(bind-key "C-s" 'consult-line custom-bindings-map)
|
(bind-key "C-s" 'consult-line custom-bindings-map)
|
||||||
(bind-key "C-M-s" 'consult-ripgrep custom-bindings-map)
|
(bind-key "C-M-s" 'consult-ripgrep custom-bindings-map)
|
||||||
|
|
||||||
; Ensure posframe is always restored when exiting a minibuffer
|
; Ensure posframe is always restored when exiting a minibuffer
|
||||||
(add-hook 'minibuffer-exit-hook
|
(add-hook 'minibuffer-exit-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(vertico-posframe-mode 1)))
|
(vertico-posframe-mode 1)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Programming
|
* Programming
|
||||||
|
Enable =hs-minor-mode= in =prog-mode= to allow for folding away comments and modules/namespaces:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(add-hook 'prog-mode-hook 'hs-minor-mode)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** smart-parens
|
** smart-parens
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package smartparens
|
(use-package smartparens
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:hook ((prog-mode text-mode markdown-mode) . smartparens-mode)
|
:hook ((prog-mode text-mode markdown-mode) . smartparens-mode)
|
||||||
:config
|
:config
|
||||||
(require 'smartparens-config))
|
(require 'smartparens-config))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Company
|
** Company
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package company
|
(use-package company
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:hook (after-init . company-mode)
|
:hook (after-init . company-mode)
|
||||||
:hook (prog-mode . company-mode)
|
:hook (prog-mode . company-mode)
|
||||||
|
@ -1058,6 +1199,7 @@ Use =embark= for in-mini-buffer actions:
|
||||||
Use =ispell= with company mode for completion in text-modes
|
Use =ispell= with company mode for completion in text-modes
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ispell
|
(use-package ispell
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
(setq ispell-dictionary "en_GB"))
|
(setq ispell-dictionary "en_GB"))
|
||||||
|
@ -1065,20 +1207,23 @@ Use =ispell= with company mode for completion in text-modes
|
||||||
|
|
||||||
** Flycheck
|
** Flycheck
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:hook (after-init. global-flycheck-mode)
|
:hook (after-init. global-flycheck-mode)
|
||||||
:config)
|
:config)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Yasnippet
|
** Yasnippet
|
||||||
Auto-completion requires yasnippet for some competions, such as function arguments and parens.
|
Auto-completion requires yasnippet for some competions, such as function arguments and parens.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package yasnippet
|
(use-package yasnippet
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:hook ((prog-mode text-mode) . yas-minor-mode))
|
:hook ((prog-mode text-mode) . yas-minor-mode))
|
||||||
|
|
||||||
(use-package yasnippet-snippets
|
(use-package yasnippet-snippets
|
||||||
:ensure t)
|
:straight t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** LSP
|
** LSP
|
||||||
|
@ -1087,6 +1232,7 @@ Emacs has its own internal LSP client called eglot, but I've never used it and I
|
||||||
LSP sets it's prefix key to =s-l= by default, which uses the Super key which I use as my Mod key in sway, so I can't use it in emacs.
|
LSP sets it's prefix key to =s-l= by default, which uses the Super key which I use as my Mod key in sway, so I can't use it in emacs.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:hook (prog-mode . lsp)
|
:hook (prog-mode . lsp)
|
||||||
:hook (lsp-mode . lsp-enable-which-key-integration)
|
:hook (lsp-mode . lsp-enable-which-key-integration)
|
||||||
|
@ -1111,6 +1257,7 @@ LSP sets it's prefix key to =s-l= by default, which uses the Super key which I u
|
||||||
)
|
)
|
||||||
|
|
||||||
(use-package lsp-treemacs
|
(use-package lsp-treemacs
|
||||||
|
:straight t
|
||||||
:commands lsp-treemacs-errors-list)
|
:commands lsp-treemacs-errors-list)
|
||||||
|
|
||||||
(use-package lsp-ui
|
(use-package lsp-ui
|
||||||
|
@ -1132,7 +1279,8 @@ LSP sets it's prefix key to =s-l= by default, which uses the Super key which I u
|
||||||
** Rust
|
** Rust
|
||||||
[[https://github.com/rust-lang/rust-mode][rust-mode]]
|
[[https://github.com/rust-lang/rust-mode][rust-mode]]
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package rust-mode
|
(use-package rust-mode
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:hook (rust-mode . lsp)
|
:hook (rust-mode . lsp)
|
||||||
:init
|
:init
|
||||||
|
@ -1142,20 +1290,36 @@ LSP sets it's prefix key to =s-l= by default, which uses the Super key which I u
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package rust-playground
|
(use-package rust-playground
|
||||||
|
:straight t
|
||||||
:defer t)
|
:defer t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
[[https://github.com/kwrooijen/cargo.el][cargo-mode]]
|
[[https://github.com/kwrooijen/cargo.el][cargo-mode]]
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package cargo-mode
|
(use-package cargo-mode
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:hook (rust-mode . cargo-minor-mode))
|
:hook (rust-mode . cargo-minor-mode)
|
||||||
|
:config
|
||||||
|
(setq cargo-mode-command-test "test -- --nocapture"))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Debugging
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package dap-mode
|
||||||
|
:straight t
|
||||||
|
:defer t
|
||||||
|
:config
|
||||||
|
(require 'dap-cpptools)
|
||||||
|
(dap-cpptools-setup)
|
||||||
|
(dap-auto-configure-mode 1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Web
|
** Web
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package web-mode
|
(use-package web-mode
|
||||||
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:mode
|
:mode
|
||||||
(("\\.phtml\\'" . web-mode)
|
(("\\.phtml\\'" . web-mode)
|
||||||
|
@ -1187,7 +1351,8 @@ LSP sets it's prefix key to =s-l= by default, which uses the Super key which I u
|
||||||
** C/C++
|
** C/C++
|
||||||
clang-format
|
clang-format
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package clang-format
|
(use-package clang-format
|
||||||
|
:straight t
|
||||||
:defer t)
|
:defer t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue