diff --git a/init.org b/init.org index 043bd73..cdebc9a 100644 --- a/init.org +++ b/init.org @@ -112,7 +112,10 @@ Backups / Auto-saves `((".*" . ,emacs-autosave-directory)) auto-save-file-name-transforms `((".*" ,emacs-autosave-directory t))) +#+end_src +Auto-save files: +#+begin_src emacs-lisp :tangle no (use-package auto-save-buffers-enhanced :ensure t :config @@ -406,10 +409,9 @@ Honestly not very happy with this at the moment, but it's kind of hacked togethe ** =magit= try out =diff-hl= for highlighting diffs in magit: -#+begin_src emacs-lisp :tangle no +#+begin_src emacs-lisp (use-package diff-hl :config - (diff-hl-margin-mode) (global-diff-hl-mode)) #+end_src @@ -465,27 +467,34 @@ Used by Spacemacs as well. (evil-mode 1) #+end_src -Evil keybinds: +Evil key-binds: #+begin_src emacs-lisp - (evil-global-set-key 'normal (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) - (evil-define-key 'normal 'global (kbd "wj") 'evil-window-down) - (evil-define-key 'normal 'global (kbd "wk") 'evil-window-up) - (evil-define-key 'normal 'global (kbd "wh") 'evil-window-left) - (evil-define-key 'normal 'global (kbd "wl") 'evil-window-right) - ;; magit - (evil-define-key 'normal 'global (kbd "gs") 'magit-status) - ; (evil-define-key 'normal 'global (kbd "gd") 'magit-diff) - (evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle) +(evil-global-set-key 'normal (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) +(evil-define-key 'normal 'global (kbd "wj") 'evil-window-down) +(evil-define-key 'normal 'global (kbd "wk") 'evil-window-up) +(evil-define-key 'normal 'global (kbd "wh") 'evil-window-left) +(evil-define-key 'normal 'global (kbd "wl") 'evil-window-right) +#+end_src - ;; org-mode - (evil-define-key 'normal 'org-mode-map (kbd "ih") 'org-insert-heading) - (evil-define-key 'normal 'org-mode-map (kbd "is") 'org-insert-subheading) - (evil-define-key 'normal 'org-mode-map (kbd "ii") 'org-insert-item) - (evil-define-key 'normal 'org-mode-map (kbd "ib") 'org-insert-structure-template) - (evil-define-key 'normal 'org-mode-map (kbd "il") 'org-insert-link) +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 "gs") 'magit-status) +;; (evil-define-key 'normal 'global (kbd "gd") 'magit-diff) +#+end_src + +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. +#+begin_src emacs-lisp +(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle) +(evil-define-key 'normal 'org-mode-map (kbd ",,") 'org-edit-src-exit) +(evil-define-key 'normal 'org-mode-map (kbd "ih") 'org-insert-heading) +(evil-define-key 'normal 'org-mode-map (kbd "is") 'org-insert-subheading) +(evil-define-key 'normal 'org-mode-map (kbd "ii") 'org-insert-item) +(evil-define-key 'normal 'org-mode-map (kbd "ib") 'org-insert-structure-template) +(evil-define-key 'normal 'org-mode-map (kbd "il") 'org-insert-link) #+end_src Close =:config=. @@ -855,7 +864,7 @@ Use consult-xref for lsp-xref and xref-find-references. (marginalia-mode 1)) #+end_src -#+begin_src emacs-lisp :tangle no +#+begin_src emacs-lisp (use-package corfu :custom ;; Enable auto completion @@ -865,11 +874,11 @@ Use consult-xref for lsp-xref and xref-find-references. ;; No delay (corfu-auto-delay 0) ;; Start when this many characters have been typed - (corfu-auto-prefix 2) + (corfu-auto-prefix 1) ;; Short delay (corfu-popupinfo-delay 0.5) - ;; Preselect the prompt - (corfu-preselect 'prompt) + ;; Preselect the first suggestion + (corfu-preselect 'first) :init (global-corfu-mode)) @@ -883,6 +892,8 @@ Use consult-xref for lsp-xref and xref-find-references. (setq read-extended-command-predicate #'command-completion-default-include-p) + (setq text-mode-ispell-word-completion nil) + ;; Enable indentation+completion using the TAB key. ;; `completion-at-point' is often bound to M-TAB. (setq tab-always-indent 'complete)) @@ -967,15 +978,25 @@ This package seems to slow down search quite a bit in common buffers like find-f (require 'smartparens-config)) #+end_src ** Company -#+begin_src emacs-lisp - (use-package company - :defer t - :hook (after-init . global-company-mode) - :config - (setq - company-minimum-prefix-length 1 - company-idle-delay 0.0)) +#+begin_src emacs-lisp :tangle no +(use-package company + :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 + :defer t + :config + (setq ispell-dictionary "en_GB")) +#+end_src + ** Flycheck #+begin_src emacs-lisp (use-package flycheck