diff options
author | Case Duckworth | 2021-08-25 23:45:31 -0500 |
---|---|---|
committer | Case Duckworth | 2021-08-25 23:45:31 -0500 |
commit | 1962f8e0c82f51be40909f358947842d1e5d6f9d (patch) | |
tree | 33c259619cf17ba5a7431eabf43a0e7ad75c2799 | |
parent | Change disabled-command-function and disable commands (diff) | |
download | emacs-1962f8e0c82f51be40909f358947842d1e5d6f9d.tar.gz emacs-1962f8e0c82f51be40909f358947842d1e5d6f9d.zip |
Change C-o, M-o, M-l bindings
C-o now opens a link with ace-link. M-o now calls `crux-smart-open-line-above'. M-l now calls `crux-smart-open-line'. `lowercase-word', the previous binding to M-l, is not really necessary; most of the time `lowercase-dwim' works fine and is bound to C-c l. I should setup a repeat-map for those, tho....
-rw-r--r-- | init.el | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/init.el b/init.el index 163d628..ced1a59 100644 --- a/init.el +++ b/init.el | |||
@@ -1027,13 +1027,30 @@ like a dumbass." | |||
1027 | (dired-async-mode +1)) | 1027 | (dired-async-mode +1)) |
1028 | 1028 | ||
1029 | (setup (:straight ace-link) | 1029 | (setup (:straight ace-link) |
1030 | (autoload 'org-element-lineage "org-element") | ||
1031 | (ace-link-setup-default) | 1030 | (ace-link-setup-default) |
1032 | (define-key erc-mode-map (kbd "C-o") #'ace-link)) | 1031 | |
1032 | ;; I use C-o here, even though it's usually `open-line', because it still | ||
1033 | ;; matches the 'o' logic given by abo-abo (it's got the Open mnemonic and | ||
1034 | ;; it's close to 'l'), and because I've given `open-line' to M-l --- I don't | ||
1035 | ;; need `downcase-word' much, and when I do, I can use `downcase-dwim', bound | ||
1036 | ;; to C-c l. | ||
1037 | (let ((key (kbd "C-o"))) | ||
1038 | (with-eval-after-load 'erc | ||
1039 | (autoload 'org-element-lineage "org-element") | ||
1040 | (define-key erc-mode-map key #'ace-link)) | ||
1041 | (with-eval-after-load 'org | ||
1042 | (define-key org-mode-map key #'ace-link-org)) | ||
1043 | (with-eval-after-load 'gnus | ||
1044 | (define-key gnus-summary-mode-map key #'ace-link-gnus) | ||
1045 | (define-key gnus-article-mode-map key #'ace-link-gnus)) | ||
1046 | (with-eval-after-load 'ert | ||
1047 | (define-key ert-results-mode-map "o" #'ace-link-help)) | ||
1048 | ;; And still everything else | ||
1049 | (setq ace-link-fallback-function #'ace-link-addr) | ||
1050 | (global-set-key key #'ace-link))) | ||
1033 | 1051 | ||
1034 | (setup (:straight avy) | 1052 | (setup (:straight avy) |
1035 | (:global "C-:" avy-goto-char | 1053 | (:global "C-'" avy-goto-char-timer |
1036 | "C-'" avy-goto-char-timer | ||
1037 | "M-g f" avy-goto-line | 1054 | "M-g f" avy-goto-line |
1038 | "M-g w" avy-goto-word-1 | 1055 | "M-g w" avy-goto-word-1 |
1039 | "C-c C-j" avy-resume) | 1056 | "C-c C-j" avy-resume) |
@@ -1169,7 +1186,8 @@ like a dumbass." | |||
1169 | (setup (:straight crux) | 1186 | (setup (:straight crux) |
1170 | 1187 | ||
1171 | (:global "C-x o" acdw/other-window-or-switch-buffer | 1188 | (:global "C-x o" acdw/other-window-or-switch-buffer |
1172 | "C-o" crux-smart-open-line | 1189 | ;; This is about to get WILD! |
1190 | "M-l" crux-smart-open-line | ||
1173 | "M-o" crux-smart-open-line-above | 1191 | "M-o" crux-smart-open-line-above |
1174 | "C-M-\\" crux-cleanup-buffer-or-region | 1192 | "C-M-\\" crux-cleanup-buffer-or-region |
1175 | "C-x 4 t" crux-transpose-windows) | 1193 | "C-x 4 t" crux-transpose-windows) |