keys.el 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. (global-set-key (kbd "<f9>") 'vterm-toggle-cd)
  2. ;;; See <https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html>.
  3. ;;; Watch about hydra <https://www.youtube.com/watch?v=_qZliI1BKzI>.
  4. (defmacro wi-define-keys (prefix prefix-map &rest args)
  5. "Define keys.
  6. PREFIX - prefix key for these bindings.
  7. PREFIX-MAP - prefix key for these bindings.
  8. Sets the following basend on PREFIX-MAP:
  9. - which - description of these bindings.
  10. - hydra - hydra function name.
  11. - hydra-comment - hydra description of these bindings.
  12. ARGS will be passed to hydra."
  13. `(progn
  14. (when (macrop #'bind-keys)
  15. (bind-keys :prefix ,prefix
  16. :prefix-map ,(intern (concat "wi-"
  17. (symbol-name prefix-map)
  18. "-map"))
  19. ,@(mapcar (lambda (arg)
  20. (let ((key (car arg))
  21. (func (cadr arg)))
  22. (cons key func)))
  23. args)
  24. ("h" . ,(intern (concat "hydra-"
  25. (symbol-name prefix-map)
  26. "/body")))))
  27. (when (functionp #'which-key-add-key-based-replacements)
  28. (which-key-add-key-based-replacements ,prefix
  29. ,(symbol-name prefix-map))
  30. (which-key-add-key-based-replacements ,(concat prefix " h")
  31. "hydra"))
  32. (when (macrop #'defhydra)
  33. (defhydra ,(intern (concat "hydra-" (symbol-name prefix-map)))
  34. (:color pink)
  35. ,(mapconcat 'identity
  36. (split-string (symbol-name prefix-map) "-")
  37. " ")
  38. ,@args
  39. ("q" nil "quit")))))
  40. (defmacro wi-define-switch-to-buffer (name buffer)
  41. `(defun ,(intern (concat "wi-switch-to-buffer-" (symbol-name name)))
  42. nil
  43. (interactive)
  44. (switch-to-buffer ,buffer)))
  45. (wi-define-switch-to-buffer guile-repl "* Guile REPL *")
  46. (wi-define-switch-to-buffer eww "*eww*")
  47. (wi-define-switch-to-buffer nekrovim "#nekrovim")
  48. (when (macrop #'bind-key)
  49. (bind-key "<Scroll_Lock>" #'scroll-lock-mode)
  50. (bind-key "<C-down-mouse-1>" 'mc/toggle-cursor-on-click)
  51. ;; (bind-key "<f5>" #'aya-create)
  52. ;; (bind-key "<f6>" #'aya-expand)
  53. ;; (bind-key "<f7>" #'mc/mark-next-like-this)
  54. ;; (bind-key "<f8>" #'er/expand-region)
  55. ;; (bind-key "<M-f6>" #'god-mode-all)
  56. ;; TODO: (bind-key "<C-tab>" #'hs-toggle-hiding scheme-mode-map)
  57. (bind-key "M-z" #'zap-up-to-char)
  58. (bind-key "C-c g u" #'undo-tree-visualize)
  59. (bind-key "C-c g o" #'ace-window))
  60. (when (boundp #'which-key-add-key-based-replacements)
  61. (which-key-add-key-based-replacements "C-c &" "yasnippet")
  62. (which-key-add-key-based-replacements "C-c g k" "engine")
  63. (which-key-add-key-based-replacements "C-c g u" "undo")
  64. (which-key-add-key-based-replacements "C-c g o" "ace-window")
  65. (which-key-add-key-based-replacements "C-c g v" "vc")
  66. (which-key-add-key-based-replacements "C-c g p x" "projectile-shell")
  67. (which-key-add-key-based-replacements "C-c g p s" "projectile-search"))
  68. (wi-define-keys "C-c g b" buffer
  69. ("b" scratch "scratch" :color blue)
  70. ("f" transpose-frame "tr frame")
  71. ("i" ibuffer "ibuffer")
  72. ("l" redraw-display "redraw")
  73. ("n" next-buffer "next")
  74. ("p" previous-buffer "previous")
  75. ("r" revert-buffer "revert")
  76. ("w" crux-transpose-windows "tr window"))
  77. (wi-define-keys "C-c g b s" buffer-switch
  78. ("e" wi-switch-to-scratch-elisp "elisp")
  79. ("g" wi-switch-to-buffer-guile-repl "guile")
  80. ("w" wi-switch-to-buffer-eww "eww"))
  81. (wi-define-keys "C-c g b s i" buffer-switch-irc
  82. ("n" wi-switch-to-buffer-nekrovim "nekrovim")
  83. ("SPC" erc-track-switch-buffer "track"))
  84. (wi-define-keys "C-c g b f" buffer-file
  85. ("d" wi-find-file-guixsd "guixsd")
  86. ("e" wi-find-file-emacs "emacs"))
  87. (wi-define-keys "C-c g b m" move-buffer
  88. ("b" buf-move-left "left")
  89. ("f" buf-move-right "right")
  90. ("n" buf-move-down "down")
  91. ("p" buf-move-up "up"))
  92. (wi-define-keys "C-c g a" text
  93. ("/" wi-dabbrev-expand "expand")
  94. ("a" align-regexp "align rx")
  95. ("P" wi-mark-paragraph+sort-lines "paragraph")
  96. ("u" undo "undo")
  97. ("p" move-text-up "up")
  98. ("n" move-text-down "down"))
  99. (wi-define-keys "C-c g a e" expand
  100. ("'" er/mark-inside-quotes "in quotes")
  101. ("P" er/mark-inside-pairs "in pairs")
  102. ("S" er/mark-symbol-with-prefix "prefix symbol")
  103. ("\"" er/mark-outside-quotes "out quotes")
  104. ("c" er/mark-comment "comment")
  105. ("d" er/mark-defun "defun")
  106. ("e" er/expand-region "region")
  107. ("E" er/mark-email "email")
  108. ("m" er/mark-method-call "method")
  109. ("n" er/mark-next-accessor "next accessor")
  110. ("p" er/mark-outside-pairs "out pairs")
  111. ("s" er/mark-symbol "symbol")
  112. ("u" er/mark-url "url")
  113. ("w" er/mark-word "word"))
  114. (wi-define-keys "C-c g a m" multicursor
  115. ("t" mc/mark-next-like-this "next like this")
  116. ("T" mc/mark-previous-like-this "previous like this")
  117. ("s" mc/mark-next-symbol-like-this "next symbol")
  118. ("S" mc/mark-previous-symbol-like-this "previous symbol")
  119. ("l" mc/mark-next-lines "next line")
  120. ("L" mc/mark-previous-lines "previous line"))
  121. (wi-define-keys "C-c g a T" text-todo
  122. ("n" hl-todo-next "next")
  123. ("o" hl-todo-occur "occur")
  124. ("p" hl-todo-previous "prev"))
  125. (wi-define-keys "C-c g a P" text-page
  126. ("[" backward-paragraph "prev paragraph")
  127. ("]" forward-paragraph "next paragraph")
  128. ("n" forward-page "next page")
  129. ("p" backward-page "prev page"))
  130. (wi-define-keys "C-c g a S" text-symbol
  131. ("n" symbol-overlay-jump-next "next")
  132. ("p" symbol-overlay-jump-prev "prev"))
  133. (wi-define-keys "C-c g a s" text-sexp
  134. ("j" sp-join-sexp "join")
  135. ("s" sp-split-sexp "split")
  136. ("S" wi-sort-sexps "sort")
  137. ("u" undo "undo"))
  138. (wi-define-keys "C-c g w" word
  139. ("t" show-translation "translate"))
  140. (wi-define-keys "C-c g v u" merge-upstream
  141. ("C" guix-mu-copy-and-commit "copy and commit")
  142. ("N" guix-mu-other-next "other next")
  143. ("P" guix-mu-other-prev "other prev")
  144. ("Y" guix-mu-copy "copy")
  145. ("c" guix-mu-commit "commit")
  146. ("h" guix-mu-hide-all "hide")
  147. ("k" guix-mu-kill-sexp "kill-sexp")
  148. ("n" guix-mu-next "next")
  149. ("o" guix-mu-other "other")
  150. ("p" guix-mu-prev "prev")
  151. ("r" guix-mu-revert "revert")
  152. ("s" hs-show-all "show")
  153. ("u" undo "undo")
  154. ("y" guix-mu-yank "yank"))
  155. (wi-define-keys "C-c g v t" timemachine
  156. ("t" git-timemachine "timemachine"))
  157. (wi-define-keys "C-c g v n" todos
  158. ("n" ivy-magit-todos "todos"))
  159. (wi-define-keys "C-c g v m" magit
  160. ("c" magit-commit "commit")
  161. ("f" magit-file-dispatch "dispatch")
  162. ("l" magit-list-repositories "repo list" :color blue)
  163. ("r" magit-diff-toggle-refine-hunk "tg refine")
  164. ("s" unpackaged/magit-status "status" :color blue))
  165. (wi-define-keys "C-c g v m r" magit-repo
  166. ("g" wi-magit-status-repo-guix "guix" :color blue))
  167. (wi-define-keys "C-c g v b" browse-at-remote
  168. ;; TODO: ("g" . wi-browse-at-remote-gnu)
  169. ("b" browse-at-remote "browse" :color blue))
  170. (wi-define-keys "C-c g v v" vc-hunk
  171. ("c" magit-commit "commit" :color blue)
  172. ("e" magit-commit-extend "extend" :color blue)
  173. ("n" git-gutter:next-hunk "next")
  174. ("l" git-messenger:popup-message "line")
  175. ("p" git-gutter:previous-hunk "previous")
  176. ("r" git-gutter:revert-hunk "revert")
  177. ("s" git-gutter:stage-hunk "stage"))
  178. (wi-define-keys "C-c g f" open
  179. ("e" guix-edit "guix package" :color blue)
  180. ("f" ffap "thing at point" :color blue)
  181. ("l" recentf-open-files "recent" :color blue)
  182. ("r" ffap-read-only "RO thing at point" :color blue))
  183. (wi-define-keys "C-c g f d" dumb-jump
  184. ("d" dumb-jump-go "go")
  185. ("g" dumb-jump-go "go")
  186. ("o" dumb-jump-go-other-window "other window")
  187. ("e" dumb-jump-go-prefer-external "go external")
  188. ("x" dumb-jump-go-prefer-external-other-window
  189. "go external other window")
  190. ("i" dumb-jump-go-prompt "prompt")
  191. ("l" dumb-jump-quick-look "quick look")
  192. ("b" dumb-jump-back "back"))
  193. (wi-define-keys "C-c g f v" find-vc
  194. ("g" wi-github-issue-at-point "gh is")
  195. ("n" next-line "next")
  196. ("p" previous-line "previous"))
  197. (wi-define-keys "C-c g f b" browse
  198. ("c" browse-url-conkeror "conkeror" :color blue)
  199. ("e" eww "eww" :color blue)
  200. ("g" browse-url-chromium "chromium" :color blue)
  201. ("i" browse-url-firefox "firefox" :color blue)
  202. ("m" browse-url-mpv "mpv" :color blue))
  203. (wi-define-keys "C-c g t" toggle
  204. ("A" auto-save-mode "autosave")
  205. ("F" flymake-mode "flymake")
  206. ("P" projectile-global-mode "projectile")
  207. ("W" display-fill-column-indicator-mode "fill-column")
  208. ("a" abbrev-mode "abbrev")
  209. ("b" guix-build-log-minor-mode "guix")
  210. ("c" company-mode "company")
  211. ("e" prettify-symbols-mode "prettify")
  212. ("g" guix-prettify-mode "guix")
  213. ("i" aggressive-indent-mode "aggressive")
  214. ("l" hl-line-mode "line")
  215. ("p" smartparens-strict-mode "smartparens")
  216. ("s" flyspell-mode "flyspell")
  217. ("t" toggle-truncate-lines "truncate")
  218. ("v" google-translate-mode "google")
  219. ("w" whitespace-mode "whitespace")
  220. ("y" yas-minor-mode "yasnippet"))
  221. (wi-define-keys "C-c g t f" flycheck
  222. ("f" flycheck-mode "toggle")
  223. ("l" flycheck-list-errors "list")
  224. ("n" flycheck-next-error "next")
  225. ("p" flycheck-previous-error "prev"))
  226. (wi-define-keys "C-c g t c" toggle-highlight
  227. ("S" highlight-sexp-mode "sexp")
  228. ("b" rainbow-blocks-mode "blocks")
  229. ("c" rainbow-mode "colors")
  230. ("d" rainbow-delimiters-mode "delimiters")
  231. ("i" rainbow-identifiers-mode "identifiers")
  232. ("q" highlight-stages-mode "stages")
  233. ("s" highlight-symbol-mode "symbol"))
  234. (wi-define-keys "C-c g h" helm
  235. ("&" helm-yas-complete "yasnippet" :color blue)
  236. ("R" helm-bookmarks "bookmarks" :color blue)
  237. ("a" helm-world-time "time" :color blue)
  238. ("b" helm-buffers-list "buffers" :color blue)
  239. ("f" helm-for-files "files" :color blue)
  240. ("i" helm-imenu "imenu" :color blue)
  241. ("j" helm-register "register" :color blue)
  242. ("r" helm-recentf "recent" :color blue)
  243. ("m" helm-make "make" :color blue)
  244. ("c" helm-resume "resume" :color blue)
  245. ("s" helm-pass "pass" :color blue)
  246. ("t" helm-top "top" :color blue)
  247. ("v" wi-helm-wigust-stream "stream" :color blue)
  248. ("w" helm-stumpwm-commands "stumpwm" :color blue)
  249. ("x" helm-M-x "M-x" :color blue)
  250. ("y" helm-show-kill-ring "kill ring" :color blue)
  251. ("8" helm-ucs "character" :color blue))
  252. (wi-define-keys "C-c g h H" helm-help
  253. ("m" helm-man-woman "man" :color blue)
  254. ("i" helm-info "info" :color blue))
  255. (wi-define-keys "C-c g i" ivy
  256. ("b" ivy-switch-buffer "switch buffer" :color blue)
  257. ("f" counsel-find-file "find file" :color blue)
  258. ("g" counsel-rg "grep" :color blue)
  259. ("l" ivy-recentf "recent" :color blue)
  260. ("r" ivy-resume "resume" :color blue)
  261. ("s" swiper "swiper" :color blue)
  262. ("x" counsel-M-x "M-x" :color blue)
  263. ("w" plain-org-wiki "org-wiki" :color blue))
  264. (wi-define-keys "C-c g i g" counsel-git
  265. ("f" counsel-git "git" :color blue)
  266. ("v" counsel-git-grep "grep" :color blue))
  267. (wi-define-keys "C-c g i h" counsel-help
  268. ("f" counsel-describe-function "function" :color blue)
  269. ("i" counsel-info-lookup-symbol "symbol" :color blue)
  270. ("l" counsel-find-library "library" :color blue)
  271. ("u" counsel-unicode-char "char" :color blue)
  272. ("v" counsel-describe-variable "variable" :color blue))
  273. (wi-define-keys "C-c g h p" helm-projectile
  274. ("b" helm-projectile-switch-to-buffer :color blue)
  275. ("f" helm-projectile-find-file-dwim :color blue)
  276. ("p" helm-projectile :color blue))
  277. (wi-define-keys "C-c g m" mail
  278. ("b" wi-send-buffer-as-mail :color blue))
  279. ;; https://endlessparentheses.com/keep-your-slack-distractions-under-control-with-emacs.html
  280. (wi-define-keys "C-c g m s" slack
  281. ("s" slack-select-rooms "select-room"))
  282. (wi-define-keys "C-c g m i" irc
  283. ("s" erc-track-switch-buffer "switch"))
  284. (wi-define-keys "C-c g e" emms
  285. ("*" pulseaudio-control-set-volume "set vol")
  286. ("+" emms-volume-raise "inc vol")
  287. ("-" emms-volume-lower "dec vol")
  288. ("C-s" helm-emms "emms" :color blue)
  289. ("P" emms-pause "pause")
  290. ("d" emms-play-directory "directory")
  291. ("e" emms "emms" :color blue)
  292. ("n" emms-next-show "next")
  293. ("p" emms-previous-show "previous")
  294. ("r" emms-random-show "random")
  295. ("s" emms-stop "stop"))
  296. (wi-define-keys "C-c g m d" debbugs
  297. ("b" debbugs-gnu-bugs "bugs" :color blue)
  298. ("l" debbugs-gnu "gnu" :color blue)
  299. ("m" wi-debbugs-gnu-list "wigust" :color blue)
  300. ("p" debbugs-gnu-patches "patches" :color blue)
  301. ("s" debbugs-gnu-search "search" :color blue))
  302. (wi-define-keys "C-c g m r" elfeed
  303. ("r" elfeed "elfeed" :color blue)
  304. ("g" elfeed-update "update"))
  305. (wi-define-keys "C-c g m g" gnus
  306. ("=" gnus-summary-expand-window "expand")
  307. ("RET" gnus-summary-scroll-up "prev page")
  308. ("S-SPC" gnus-summary-prev-page "next page")
  309. ("SPC" gnus-summary-next-page "scroll")
  310. ("d" wi-gnus-browse-debbugs :color :blue)
  311. ("g" gnus "gnus" :color blue)
  312. ("G" mbsync "mbsync" :color blue)
  313. ("k" gnus-summary-kill-thread "kill thread")
  314. ("n" gnus-summary-next-article "next article")
  315. ("p" gnus-summary-prev-article "prev article")
  316. ("o" gnus-summary-top-thread "top thread")
  317. ("s" switch-to-gnus "switch" :color blue))
  318. (wi-define-keys "C-c g m g m" gnus-message
  319. (";" wi-replace-with-brackets-ellipsis "ellipsis"))
  320. (wi-define-keys "C-c g m X" redshift
  321. ("g" redshift-set-temp "set")
  322. ("n" redshift-decrease-temp "decrease")
  323. ("p" redshift-increase-temp "increase"))
  324. (wi-define-keys "C-c g s" shell
  325. ("r" counsel-tramp :color blue)
  326. ("e" eshell "eshell" :color blue)
  327. ("m" terminal-here-project-launch-multiplexer "xterm" :color blue)
  328. ("t" term "ansi" :color blue)
  329. ("x" terminal-here-project-launch "xterm" :color blue))
  330. (wi-define-keys "C-c g s s" shell-dumb
  331. ("M-r" helm-shell-history "history" :color blue)
  332. ("C" compilation-shell-minor-mode "complition" :color blue)
  333. ("c" wi-shell-cd-current-dir "cd" :color blue)
  334. ("s" shell "shell" :color blue))
  335. (wi-define-keys "C-c g c" org
  336. ("C" open-todo-file-open "new todo file")
  337. ("a" org-agenda "agenda" :color blue)
  338. ("c" org-capture "capture" :color blue)
  339. ("l" org-store-link "link"))
  340. (when (boundp #'-lambda)
  341. (mapc (-lambda ((hook key proc))
  342. (add-hook hook `(lambda ()
  343. (local-set-key (kbd ,key) ',proc))))
  344. '((scheme-mode-hook "<C-return>" eir-eval-in-geiser)
  345. (sh-mode-hook "C-<return>" eir-eval-in-shell)
  346. (lisp-mode-hook "C-<return>" eir-eval-in-slime)
  347. (python-mode-hook "C-<return>" eir-eval-in-python)
  348. (emacs-lisp-mode-hook "C-<return>" eir-eval-in-ielm))))
  349. (with-eval-after-load 'guix-ui-package
  350. (let ((map guix-output-list-mode-map))
  351. (define-key map (kbd "<f6>") 'hl-line-mode)))
  352. ;; Encrypt Email message with Gnupg
  353. (with-eval-after-load 'message
  354. (let ((map message-mode-map))
  355. (define-key map (kbd "C-c s") 'ispell-region)
  356. (define-key map (kbd "C-c e") 'wi-replace-with-brackets-ellipsis)))
  357. (with-eval-after-load 'elisp-mode
  358. (let ((map emacs-lisp-mode-map))
  359. (define-key map (kbd "C-c C-z") 'wi-switch-to-scratch-elisp)))
  360. (with-eval-after-load 'view
  361. (let ((map view-mode-map))
  362. (define-key map (kbd "<f8>") 'delete-current-buffer-file)))
  363. (let ((map text-mode-map))
  364. (define-key map (kbd "<f7>") 'aya-create)
  365. (define-key map (kbd "<f8>") 'aya-expand))
  366. (with-eval-after-load 'prog-mode
  367. (let ((map prog-mode-map))
  368. (define-key map (kbd "<f5>") 'recompile)
  369. (define-key map (kbd "<f6>") 'rg)
  370. (define-key map (kbd "<f7>") 'symbol-overlay-mode)
  371. (define-key map (kbd "<f8>") 'symbol-overlay-remove-all)
  372. (define-key map (kbd "M-i") 'symbol-overlay-put)
  373. (define-key map (kbd "M-n") 'symbol-overlay-switch-forward)
  374. (define-key map (kbd "M-p") 'symbol-overlay-switch-backward)
  375. (define-key map (kbd "S-<return>") 'vc-next-action)))
  376. (with-eval-after-load 'perl-mode
  377. (let ((map perl-mode-map))
  378. (define-key map (kbd "M-.") 'dumb-jump-go)))
  379. (with-eval-after-load 'nix-mode
  380. (let ((map nix-mode-map))
  381. (define-key map (kbd "M-.") 'dumb-jump-go)
  382. (define-key map (kbd "C-c C-z") 'nix-repl)))
  383. ;; (with-eval-after-load 'c-mode
  384. ;; (let ((map c-mode-map))
  385. ;; (define-key map (kbd "M-.") 'dumb-jump-go)))
  386. ;; (with-eval-after-load 'java-mode
  387. ;; (let ((map java-mode-map))
  388. ;; (define-key map (kbd "M-.") 'dumb-jump-go)))
  389. ;; (with-eval-after-load 'js-mode
  390. ;; (let ((map js-mode-map))
  391. ;; (define-key map (kbd "M-.") 'dumb-jump-go)))
  392. ;; (with-eval-after-load 'php-mode
  393. ;; (let ((map php-mode-map))
  394. ;; (define-key map (kbd "M-.") 'dumb-jump-go)))
  395. (with-eval-after-load 'gnus-art
  396. (let ((map gnus-article-mode-map))
  397. (define-key map (kbd "C-c c") 'wi-magit-show-commit-guix)
  398. (define-key map (kbd "C-c d") 'wi-gnus-browse-debbugs)
  399. (define-key map (kbd "C-c b") 'wi-gnus-browse-guix-issues)))
  400. (with-eval-after-load 'grep
  401. (let ((map grep-mode-map))
  402. (define-key map (kbd "C-j") 'compile-goto-error)))
  403. (with-eval-after-load 'info
  404. (let ((map Info-mode-map))
  405. (define-key map (kbd "<f8>") 'wi-info-remote-copy-current-node)))
  406. (when (macrop #'defhydra)
  407. (defhydra hydra-dabbrev-expand
  408. (:color red)
  409. "dabbrev-expand"
  410. ("/" wi-dabbrev-expand "expand")
  411. ("u" undo "undo"))
  412. (defhydra hydra-spelling ()
  413. "
  414. ^
  415. ^Spelling^ ^Errors^ ^Checker^
  416. ^────────^──────────^──────^────────────^───────^───────
  417. _q_ quit _<_ previous _c_ correction
  418. ^^ _>_ next _d_ dictionary
  419. ^^ _f_ check _m_ mode
  420. ^^ ^^ ^^
  421. "
  422. ("q" nil)
  423. ("<" flyspell-correct-previous :color pink)
  424. (">" flyspell-correct-next :color pink)
  425. ("c" ispell)
  426. ("d" ispell-change-dictionary)
  427. ("f" flyspell-buffer)
  428. ("m" flyspell-mode)))
  429. (dolist (elt '((compile . compilation-mode-map)
  430. (grep . grep-mode-map)
  431. (ivy . ivy-occur-grep-mode-map)
  432. (ag . ag-mode-map)
  433. (ack . ack-mode-map)))
  434. (eval-after-load (car elt)
  435. `(progn
  436. (define-key ,(cdr elt) (kbd "+")
  437. #'grep-context-more-around-point)
  438. (define-key ,(cdr elt) (kbd "-")
  439. #'grep-context-less-around-point))))