summaryrefslogtreecommitdiff
path: root/modules/flyspell-and-abbrev.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/flyspell-and-abbrev.el')
-rw-r--r--modules/flyspell-and-abbrev.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/modules/flyspell-and-abbrev.el b/modules/flyspell-and-abbrev.el
index 12e0d348..e29ad6e9 100644
--- a/modules/flyspell-and-abbrev.el
+++ b/modules/flyspell-and-abbrev.el
@@ -111,7 +111,6 @@
;; ------------------------------ Flyspell Toggle ------------------------------
;; easy toggling flyspell and also leverage the 'for-buffer-type' functionality.
-;;;###autoload
(defun cj/flyspell-toggle ()
"Turn Flyspell on if it is off, or off if it is on.
@@ -198,7 +197,6 @@ buffer."
(downcase misspelled-word)
nil)))
-;;;###autoload
(defun cj/flyspell-then-abbrev (p)
"Find and correct the previous misspelled word, creating an abbrev.
@@ -236,10 +234,21 @@ Press C-' repeatedly to step through misspellings one at a time."
;; -------------------------------- Keybindings --------------------------------
;; Global keybindings for spell checking commands
-;; With autoload cookies, these will lazy-load the file when pressed
-;;;###autoload (keymap-set global-map "C-c f" #'cj/flyspell-toggle)
-;;;###autoload (keymap-set global-map "C-'" #'cj/flyspell-then-abbrev)
+;; Set global keybindings
+(keymap-set global-map "C-c f" #'cj/flyspell-toggle)
+(keymap-set global-map "C-'" #'cj/flyspell-then-abbrev)
+
+;; Override org-mode's C-' binding (org-cycle-agenda-files)
+;; Org-mode binds C-' globally, but we want our spell check binding instead
+(with-eval-after-load 'org
+ (keymap-set org-mode-map "C-'" #'cj/flyspell-then-abbrev))
+
+;; which-key labels
+(with-eval-after-load 'which-key
+ (which-key-add-key-based-replacements
+ "C-c f" "flyspell toggle"
+ "C-'" "flyspell then abbrev"))
(provide 'flyspell-and-abbrev)
;;; flyspell-and-abbrev.el ends here.