From 4e9ea9b3e3039de66d8e63f6c74646a092d73b8d Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 20 Apr 2022 18:53:22 -0700 Subject: text: configure (d)abbrev modes --- emacs/custom/my-text.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'emacs') diff --git a/emacs/custom/my-text.el b/emacs/custom/my-text.el index c926be3..3d8c9fd 100644 --- a/emacs/custom/my-text.el +++ b/emacs/custom/my-text.el @@ -16,6 +16,20 @@ (when (executable-find "pandoc") (setq markdown-command "pandoc -f markdown -t html")) +(require 'dabbrev) +(require 'abbrev) +(let ((map global-map)) + (define-key map (kbd "M-/") #'dabbrev-expand) + (define-key map (kbd "C-x M-/") #'dabbrev-completion)) + +(setq only-global-abbrevs nil) +(let ((table text-mode-abbrev-table)) + (define-abbrev table "github" "GitHub") + (define-abbrev table "emacs" "Emacs")) + +(dolist (hook '(text-mode-hook git-commit-mode-hook)) + (add-hook hook #'abbrev-mode)) + (provide 'my-text) ;;; my-text.el ends here -- cgit 1.4.1