From 1962f8e0c82f51be40909f358947842d1e5d6f9d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 25 Aug 2021 23:45:31 -0500 Subject: 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.... --- init.el | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'init.el') 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." (dired-async-mode +1)) (setup (:straight ace-link) - (autoload 'org-element-lineage "org-element") (ace-link-setup-default) - (define-key erc-mode-map (kbd "C-o") #'ace-link)) + + ;; I use C-o here, even though it's usually `open-line', because it still + ;; matches the 'o' logic given by abo-abo (it's got the Open mnemonic and + ;; it's close to 'l'), and because I've given `open-line' to M-l --- I don't + ;; need `downcase-word' much, and when I do, I can use `downcase-dwim', bound + ;; to C-c l. + (let ((key (kbd "C-o"))) + (with-eval-after-load 'erc + (autoload 'org-element-lineage "org-element") + (define-key erc-mode-map key #'ace-link)) + (with-eval-after-load 'org + (define-key org-mode-map key #'ace-link-org)) + (with-eval-after-load 'gnus + (define-key gnus-summary-mode-map key #'ace-link-gnus) + (define-key gnus-article-mode-map key #'ace-link-gnus)) + (with-eval-after-load 'ert + (define-key ert-results-mode-map "o" #'ace-link-help)) + ;; And still everything else + (setq ace-link-fallback-function #'ace-link-addr) + (global-set-key key #'ace-link))) (setup (:straight avy) - (:global "C-:" avy-goto-char - "C-'" avy-goto-char-timer + (:global "C-'" avy-goto-char-timer "M-g f" avy-goto-line "M-g w" avy-goto-word-1 "C-c C-j" avy-resume) @@ -1169,7 +1186,8 @@ like a dumbass." (setup (:straight crux) (:global "C-x o" acdw/other-window-or-switch-buffer - "C-o" crux-smart-open-line + ;; This is about to get WILD! + "M-l" crux-smart-open-line "M-o" crux-smart-open-line-above "C-M-\\" crux-cleanup-buffer-or-region "C-x 4 t" crux-transpose-windows) -- cgit 1.4.1-21-gabe81