diff --git a/init.org b/init.org index 5263082..c3a8d0c 100644 --- a/init.org +++ b/init.org @@ -49,7 +49,7 @@ tangled, and the tangled file is compiled." ;; Avoid running hooks when tangling. (let ((prog-mode-hook nil)) (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) @@ -158,7 +158,8 @@ Then, install =use-package= and tell it to always assume =:straight=: load org early to work around version mismatches: #+begin_src emacs-lisp -(straight-use-package 'org) +(use-package org + :straight t) #+end_src 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]]: #+begin_src emacs-lisp -(evil-global-set-key 'normal (kbd "TAB") 'mode-line-other-buffer) +(evil-define-key 'normal 'global (kbd "TAB") 'mode-line-other-buffer) (evil-define-key 'normal 'global (kbd "bb") 'consult-buffer) (evil-define-key 'normal 'global (kbd "bd") 'kill-current-buffer) (evil-define-key 'normal 'global (kbd "ff") 'find-file) @@ -654,26 +655,26 @@ Also use =undo-fu=, which evil can use. * Writing ** Olivetti #+begin_src emacs-lisp - (use-package olivetti - :straight t - :defer t - ; :bind (:map custom-bindings-map ("C-c o" . olivetti-mode)) - :config - (setq olivetti-style t)) - - (add-hook 'olivetti-mode-on-hook (lambda () (olivetti-set-width 88))) +(use-package olivetti + :straight t + :defer t + ;; :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 + (setq olivetti-style t)) #+end_src ** Spelling #+begin_src emacs-lisp - (use-package jinx - :straight t - :hook (emacs-startup . global-jinx-mode) - :bind (("M-$" . jinx-correct) - ("C-M-$" . jinx-languages)) - :config - (evil-define-key 'normal 'global (kbd "Ss") 'jinx-correct) - (setq jinx-languages "en_GB dk_DK de_DE")) +(use-package jinx + :straight t + :hook (emacs-startup . global-jinx-mode) + :bind (("M-$" . jinx-correct) + ("C-M-$" . jinx-languages)) + :config + (evil-define-key 'normal 'global (kbd "Ss") 'jinx-correct) + (setq jinx-languages "en_GB dk_DK de_DE")) #+end_src ** LaTeX @@ -714,7 +715,6 @@ Taken from [[https://sophiebos.io/posts/prettifying-emacs-org-mode/][ here]]. (use-package org :straight t :defer t - :hook (org-mode . olivetti-mode) :hook (org-mode . variable-pitch-mode) ;; I basically always want to be running =visual-line-mode= anyway, but certainly in org-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 :defer t ;; 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 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 Use =vertico-posframe= to make the =vertico= buffer floating in the centre of the frame. #+begin_src emacs-lisp (use-package vertico-posframe :straight t + ;; Ensure posframe is always restored when exiting a minibuffer + :hook (minibuffer-exit . (lambda () (vertico-posframe-mode 1))) :config (vertico-posframe-mode 1) (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)) (t posframe)) )) +#+end_src +#+begin_src emacs-lisp (use-package savehist :straight t :init (savehist-mode)) @@ -1022,6 +1027,7 @@ Auto-completion using =corfu=: (corfu-popupinfo-delay 0.5) ;; Preselect the first suggestion (corfu-preselect 'first) + (corfu-on-exact-match nil) :init (global-corfu-mode)) @@ -1368,7 +1374,9 @@ Use =zls= automatically with lsp, and =zig-mode=: (use-package zig-mode :straight t :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 * Keybinds