This commit is contained in:
Janis 2024-10-17 20:22:49 +02:00
parent 330cb15193
commit db5a92e88c

View file

@ -49,7 +49,7 @@ tangled, and the tangled file is compiled."
;; 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)
@ -158,7 +158,8 @@ Then, install =use-package= and tell it to always assume =:straight=:
load org early to work around version mismatches: load org early to work around version mismatches:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(straight-use-package 'org) (use-package org
:straight t)
#+end_src #+end_src
Add package repositories and rank them by priority Add package repositories and rank them by priority
@ -535,7 +536,7 @@ 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
(evil-global-set-key 'normal (kbd "<SPC>TAB") 'mode-line-other-buffer) (evil-define-key 'normal 'global (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)
(evil-define-key 'normal 'global (kbd "<SPC>bd") 'kill-current-buffer) (evil-define-key 'normal 'global (kbd "<SPC>bd") 'kill-current-buffer)
(evil-define-key 'normal 'global (kbd "<SPC>ff") 'find-file) (evil-define-key 'normal 'global (kbd "<SPC>ff") 'find-file)
@ -654,19 +655,19 @@ Also use =undo-fu=, which evil can use.
* Writing * Writing
** Olivetti ** Olivetti
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package olivetti (use-package olivetti
:straight t :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))
:hook (org-mode . olivetti-mode)
:hook (olivetti-mode-on . (lambda () (olivetti-set-width 88)))
:config :config
(setq olivetti-style t)) (setq olivetti-style t))
(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 :straight t
:hook (emacs-startup . global-jinx-mode) :hook (emacs-startup . global-jinx-mode)
:bind (("M-$" . jinx-correct) :bind (("M-$" . jinx-correct)
@ -714,7 +715,6 @@ Taken from [[https://sophiebos.io/posts/prettifying-emacs-org-mode/][ here]].
(use-package org (use-package org
:straight t :straight t
:defer t :defer t
: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)
@ -927,7 +927,7 @@ Use the =move-text= package to move the current line or selection up or down wit
:straight t :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-select-window))
) )
@ -959,15 +959,18 @@ Use the =move-text= package to move the current line or selection up or down wit
(setq vertico-count 25 (setq vertico-count 25
completion-ignore-case t completion-ignore-case t
read-buffer-completion-ignore-case t read-buffer-completion-ignore-case t
read-file-name-completion-ignore-case t)) read-file-name-completion-ignore-case t)
(vertico-multiform-mode)
)
(vertico-multiform-mode)
#+end_src #+end_src
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 :straight t
;; Ensure posframe is always restored when exiting a minibuffer
:hook (minibuffer-exit . (lambda () (vertico-posframe-mode 1)))
:config :config
(vertico-posframe-mode 1) (vertico-posframe-mode 1)
(setq vertico-posframe-height vertico-count (setq vertico-posframe-height vertico-count
@ -977,7 +980,9 @@ Use =vertico-posframe= to make the =vertico= buffer floating in the centre of th
(embark-act (:not posframe)) (embark-act (:not posframe))
(t posframe)) (t posframe))
)) ))
#+end_src
#+begin_src emacs-lisp
(use-package savehist (use-package savehist
:straight t :straight t
:init (savehist-mode)) :init (savehist-mode))
@ -1022,6 +1027,7 @@ Auto-completion using =corfu=:
(corfu-popupinfo-delay 0.5) (corfu-popupinfo-delay 0.5)
;; Preselect the first suggestion ;; Preselect the first suggestion
(corfu-preselect 'first) (corfu-preselect 'first)
(corfu-on-exact-match nil)
:init :init
(global-corfu-mode)) (global-corfu-mode))
@ -1368,7 +1374,9 @@ Use =zls= automatically with lsp, and =zig-mode=:
(use-package zig-mode (use-package zig-mode
:straight t :straight t
: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
lsp-zig-build-on-save-step "build"))
#+end_src #+end_src
* Keybinds * Keybinds