stuff? ?!
This commit is contained in:
parent
8b9ae374ea
commit
c26662171d
203
init.org
203
init.org
|
@ -531,6 +531,7 @@ Used by Spacemacs as well.
|
||||||
(setq evil-want-C-u-scroll t)
|
(setq evil-want-C-u-scroll t)
|
||||||
(setq evil-want-keybinding nil)
|
(setq evil-want-keybinding nil)
|
||||||
(setq evil-want-integration t)
|
(setq evil-want-integration t)
|
||||||
|
(setq evil-undo-system 'undo-fu)
|
||||||
:config
|
:config
|
||||||
(evil-mode 1)
|
(evil-mode 1)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
@ -789,6 +790,12 @@ End =:config=
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Install various export packages:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package ox-epub
|
||||||
|
:straight t)
|
||||||
|
#+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
|
||||||
|
@ -940,6 +947,8 @@ Use the =move-text= package to move the current line or selection up or down wit
|
||||||
:defer t
|
:defer t
|
||||||
;; hijack projectile prefix because they fit together
|
;; hijack projectile prefix because they fit together
|
||||||
:bind (("C-x p t" . treemacs-select-window))
|
:bind (("C-x p t" . treemacs-select-window))
|
||||||
|
:config
|
||||||
|
(setq treemacs-width 25)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1014,6 +1023,23 @@ Use =consult-xref= for =lsp-xref= and =xref-find-references=.
|
||||||
())
|
())
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun my-consult-line-wrapper ()
|
||||||
|
(interactive)
|
||||||
|
(vertico-posframe-mode -1)
|
||||||
|
(consult-line)
|
||||||
|
(vertico-posframe-mode 1))
|
||||||
|
|
||||||
|
(defun my-consult-ripgrep-wrapper ()
|
||||||
|
(interactive)
|
||||||
|
(vertico-posframe-mode -1)
|
||||||
|
(consult-ripgrep)
|
||||||
|
(vertico-posframe-mode 1))
|
||||||
|
|
||||||
|
(bind-key "C-s" 'consult-line custom-bindings-map)
|
||||||
|
(bind-key "C-M-s" 'consult-ripgrep custom-bindings-map)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
[[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
|
||||||
|
@ -1022,6 +1048,38 @@ Use =consult-xref= for =lsp-xref= and =xref-find-references=.
|
||||||
(marginalia-mode 1))
|
(marginalia-mode 1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp :tangle no
|
||||||
|
(use-package vertico-prescient
|
||||||
|
:straight t
|
||||||
|
:after vertico
|
||||||
|
:init
|
||||||
|
(vertico-prescient-mode 1)
|
||||||
|
)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Company - Auto-Completion
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package company
|
||||||
|
:straight t
|
||||||
|
:defer t
|
||||||
|
:hook (after-init . company-mode)
|
||||||
|
:hook (prog-mode . company-mode)
|
||||||
|
:config
|
||||||
|
(setq
|
||||||
|
company-minimum-prefix-length 1
|
||||||
|
company-idle-delay 0.0))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Use =ispell= with company mode for completion in text-modes
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package ispell
|
||||||
|
:straight t
|
||||||
|
:defer t
|
||||||
|
:config
|
||||||
|
(setq ispell-dictionary "en_GB"))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** COMMENT Corfu - Auto-Completion
|
||||||
Auto-completion using =corfu=:
|
Auto-completion using =corfu=:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package corfu
|
(use-package corfu
|
||||||
|
@ -1040,7 +1098,7 @@ Auto-completion using =corfu=:
|
||||||
;; Preselect the first suggestion
|
;; Preselect the first suggestion
|
||||||
(corfu-preselect 'first)
|
(corfu-preselect 'first)
|
||||||
(corfu-on-exact-match nil)
|
(corfu-on-exact-match nil)
|
||||||
:init
|
:config
|
||||||
(global-corfu-mode))
|
(global-corfu-mode))
|
||||||
|
|
||||||
(use-package corfu-terminal
|
(use-package corfu-terminal
|
||||||
|
@ -1053,13 +1111,13 @@ Auto-completion using =corfu=:
|
||||||
)
|
)
|
||||||
|
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
:custom
|
;; :custom
|
||||||
;; TODO
|
;; TODO
|
||||||
(enable-recursive-minibuffers t)
|
|
||||||
:init
|
:init
|
||||||
;; TAB cycle if there are only few candidates
|
;; TAB cycle if there are only few candidates
|
||||||
(setq completion-cycle-threshold 3)
|
;; (setq completion-cycle-threshold 3)
|
||||||
|
|
||||||
|
(setq enable-recursive-minibuffers t)
|
||||||
;; Hide commands in M-x which do not apply to the current mode. Corfu
|
;; Hide commands in M-x which do not apply to the current mode. Corfu
|
||||||
;; commands are hidden, since they are not supposed to be used via M-x.
|
;; commands are hidden, since they are not supposed to be used via M-x.
|
||||||
(setq read-extended-command-predicate
|
(setq read-extended-command-predicate
|
||||||
|
@ -1120,19 +1178,8 @@ This package seems to slow down search quite a bit in common buffers like find-f
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Fuzzy and out-of-order completion matching using =orderless=:
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package orderless
|
|
||||||
:straight t
|
|
||||||
:config
|
|
||||||
(setq completion-styles '(prescient orderless basic partial-completion)
|
|
||||||
orderless-matching-styles '(orderless-flex)
|
|
||||||
completion-category-overrides '((file (styles basic partial-completion)))
|
|
||||||
orderless-component-separator "[ |]"))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
Use =embark= for in-mini-buffer actions:
|
Use =embark= for in-mini-buffer actions:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package embark
|
(use-package embark
|
||||||
:straight t
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
|
@ -1146,49 +1193,45 @@ Use =embark= for in-mini-buffer actions:
|
||||||
:hook (embark-collect-mode . consult-preview-at-point-mode))
|
:hook (embark-collect-mode . consult-preview-at-point-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Use =prescient= to sort completion candidates:
|
Use =corfu-prescient= to sort completion candidates:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package corfu-prescient
|
||||||
|
:straight t
|
||||||
|
:after prescient
|
||||||
|
:after corfu
|
||||||
|
;; :hook (corfu-mode . corfu-prescient-mode)
|
||||||
|
;; :hook (text-mode . corfu-prescient-mode)
|
||||||
|
:config
|
||||||
|
(setq corfu-prescient-completion-styles '(prescient orderless basic partial-completion))
|
||||||
|
(corfu-prescient-mode 1)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defun nemo/reset-corfu-prescient ()
|
||||||
|
(interactive)
|
||||||
|
(corfu-prescient-mode -1)
|
||||||
|
(corfu-prescient-mode 1)
|
||||||
|
)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Orderless & Prescient
|
||||||
|
Install =prescient= package:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package prescient
|
(use-package prescient
|
||||||
:straight t
|
:straight t
|
||||||
:after corfu
|
|
||||||
:defer t
|
|
||||||
:config
|
:config
|
||||||
|
(add-to-list 'completion-styles 'prescient)
|
||||||
(add-to-list 'prescient-filter-method 'fuzzy))
|
(add-to-list 'prescient-filter-method 'fuzzy))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
(use-package corfu-prescient
|
Fuzzy and out-of-order completion matching using =orderless=:
|
||||||
:straight t
|
#+begin_src emacs-lisp
|
||||||
:after corfu
|
(use-package orderless
|
||||||
:straight t
|
:straight t
|
||||||
:config
|
:config
|
||||||
(setq corfu-prescient-completion-styles '(prescient orderless basic partial-completion))
|
(add-to-list 'completion-styles 'orderless)
|
||||||
(corfu-prescient-mode 1))
|
(setq orderless-matching-styles '(orderless-flex)
|
||||||
#+end_src
|
completion-category-overrides '((file (styles basic partial-completion)))
|
||||||
|
orderless-component-separator "[ |]"))
|
||||||
After loading =orderless= and =prescient=, configure the =completion-styles= list:
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(setq completion-styles '(prescient orderless basic partial-completion))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(defun my-consult-line-wrapper ()
|
|
||||||
(interactive)
|
|
||||||
(vertico-posframe-mode -1)
|
|
||||||
(consult-line)
|
|
||||||
(vertico-posframe-mode 1))
|
|
||||||
|
|
||||||
(defun my-consult-ripgrep-wrapper ()
|
|
||||||
(interactive)
|
|
||||||
(vertico-posframe-mode -1)
|
|
||||||
(consult-ripgrep)
|
|
||||||
(vertico-posframe-mode 1))
|
|
||||||
|
|
||||||
(bind-key "C-s" 'consult-line custom-bindings-map)
|
|
||||||
(bind-key "C-M-s" 'consult-ripgrep custom-bindings-map)
|
|
||||||
|
|
||||||
; Ensure posframe is always restored when exiting a minibuffer
|
|
||||||
(add-hook 'minibuffer-exit-hook
|
|
||||||
(lambda ()
|
|
||||||
(vertico-posframe-mode 1)))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Programming
|
* Programming
|
||||||
|
@ -1197,6 +1240,17 @@ Enable =hs-minor-mode= in =prog-mode= to allow for folding away comments and mod
|
||||||
(add-hook 'prog-mode-hook 'hs-minor-mode)
|
(add-hook 'prog-mode-hook 'hs-minor-mode)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** hl-todo
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package hl-todo
|
||||||
|
:straight t
|
||||||
|
:hook ((prog-mode) . hl-todo-mode)
|
||||||
|
:config
|
||||||
|
(setq hl-todo-keyword-faces
|
||||||
|
'(("TODO" . "#e78a4e")))
|
||||||
|
)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** smart-parens
|
** smart-parens
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package smartparens
|
(use-package smartparens
|
||||||
|
@ -1207,28 +1261,6 @@ Enable =hs-minor-mode= in =prog-mode= to allow for folding away comments and mod
|
||||||
(require 'smartparens-config))
|
(require 'smartparens-config))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Company
|
|
||||||
#+begin_src emacs-lisp :tangle no
|
|
||||||
(use-package company
|
|
||||||
:straight t
|
|
||||||
:defer t
|
|
||||||
:hook (after-init . company-mode)
|
|
||||||
:hook (prog-mode . company-mode)
|
|
||||||
:config
|
|
||||||
(setq
|
|
||||||
company-minimum-prefix-length 1
|
|
||||||
company-idle-delay 0.0))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
Use =ispell= with company mode for completion in text-modes
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package ispell
|
|
||||||
:straight t
|
|
||||||
:defer t
|
|
||||||
:config
|
|
||||||
(setq ispell-dictionary "en_GB"))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
** Flycheck
|
** Flycheck
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
|
@ -1410,7 +1442,30 @@ Use =zls= automatically with lsp, and =zig-mode=:
|
||||||
:config
|
:config
|
||||||
(add-to-list 'auto-mode-alist '("\\.zig\\'" . zig-mode))
|
(add-to-list 'auto-mode-alist '("\\.zig\\'" . zig-mode))
|
||||||
(setq lsp-zig-enable-build-on-save t
|
(setq lsp-zig-enable-build-on-save t
|
||||||
lsp-zig-build-on-save-step "build"))
|
lsp-zig-enable-inlay-hints nil
|
||||||
|
lsp-zig-build-on-save-step "check"))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* User Functions
|
||||||
|
=PascalCase= to =snake_case=:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun snake-case ()
|
||||||
|
"convert region from PascalCase into snake_case"
|
||||||
|
(interactive)
|
||||||
|
(save-excursion
|
||||||
|
(let ((bounds (bounds-of-thing-at-point 'symbol)))
|
||||||
|
(replace-regexp "\\([A-Z]\\)" "_\\1" nil (1+ (car bounds)) (cdr bounds))
|
||||||
|
(downcase-region (car bounds) (cdr (bounds-of-thing-at-point 'word)))))
|
||||||
|
)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
Shortcut for opening this file:
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun nemo/edit-init-org ()
|
||||||
|
"Open the init.org file."
|
||||||
|
(interactive)
|
||||||
|
(find-file (concat user-emacs-directory "/init.org"))
|
||||||
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Keybinds
|
* Keybinds
|
||||||
|
|
Loading…
Reference in a new issue