From fc5f4bdc13702ccf20063fb18f48a854ec80a8b2 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 30 Jun 2021 18:05:04 +0200 Subject: [PATCH] Added org keybindings and spell checking --- doom/config.el | 38 ++++++++++++++++++++++++++++++++++++++ doom/init.el | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/doom/config.el b/doom/config.el index 29ea17a..0a3e47f 100644 --- a/doom/config.el +++ b/doom/config.el @@ -58,6 +58,44 @@ (map! :desc "Decrease font size" :n "C--" #'text-scale-decrease) (map! :desc "Reset font size" :n "C-=" #'doom/reset-font-size) + +;; Org-mode custom keybindings + +(map! :map evil-org-mode-map :nvi "C-k" #'org-backward-element) +(map! :map evil-org-mode-map :nvi "C-j" #'org-forward-element) +(map! :map evil-org-mode-map :nvi "C-h" #'org-up-element) +(map! :map evil-org-mode-map :nvi "C-l" #'org-down-element) + + +;; Spell checking settings +;; TODO make toggling of spell checking ('SPC t s') use flyspell-mode in text modes and flyspell-prog-mode in programming modes (see hooks below) +;; Removing hooks for automatic spell checking set here: https://github.com/hlissner/doom-emacs/blob/develop/modules/checkers/spell/config.el +(remove-hook! '(org-mode-hook + markdown-mode-hook + TeX-mode-hook + rst-mode-hook + mu4e-compose-mode-hook + message-mode-hook + git-commit-mode-hook) + #'flyspell-mode) + +(remove-hook! '(yaml-mode-hook + conf-mode-hook + prog-mode-hook) + #'flyspell-prog-mode) + +(setq ispell-dictionary "english") + +(map! :map doom-leader-toggle-map :desc "Toggle dictionary" "d" #'fd-switch-dictionary) + +(defun fd-switch-dictionary() + (interactive) + (let* ((dic ispell-current-dictionary) + (change (if (string= dic "german") "english" "german"))) + (ispell-change-dictionary change) + (message "Dictionary switched from %s to %s" dic change) + )) + ;; (autoload 'matlab-mode "matlab" "Matlab Editing Mode" t) ;; (add-to-list ;; 'auto-mode-alist diff --git a/doom/init.el b/doom/init.el index 4d4b94e..49f9d98 100644 --- a/doom/init.el +++ b/doom/init.el @@ -80,7 +80,7 @@ :checkers syntax ; tasing you for every semicolon you forget - ;;(spell +flyspell) ; tasing you for misspelling mispelling + (spell +flyspell +everywhere) ; tasing you for misspelling mispelling ;;grammar ; tasing grammar mistake every you make :tools