diff options
Diffstat (limited to '.emacs.d/lisp/init-navigation.el')
-rw-r--r-- | .emacs.d/lisp/init-navigation.el | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/.emacs.d/lisp/init-navigation.el b/.emacs.d/lisp/init-navigation.el index 513d580..b407e7b 100644 --- a/.emacs.d/lisp/init-navigation.el +++ b/.emacs.d/lisp/init-navigation.el @@ -7,6 +7,13 @@ (avy-all-windows nil) (avy-all-windows-alt t) (avy-timeout-seconds 0.3) + :init + ;; Allow C-[ to be bound (instead of being equivalent to ESC), but only in GUI Emacs + ;; https://emacs.stackexchange.com/a/52334 + (let ((frame (framep (selected-frame)))) + (or (eq t frame) + (eq 'pc frame) + (define-key input-decode-map (kbd "C-[") [control-bracketleft]))) :config ;; https://karthinks.com/software/avy-can-do-anything/#avy-plus-embark-any-action-anywhere (defun avy-action-embark (pt) @@ -17,14 +24,14 @@ (select-window (cdr (ring-ref avy-ring 0)))) t) - (add-to-list 'avy-dispatch-alist '(111 . avy-action-embark)) + (add-to-list 'avy-dispatch-alist '(?o . avy-action-embark)) (defun avy-copy-as-kill () (interactive) (avy-goto-char-timer) (let ((beg (point))) (avy-goto-char-timer) (copy-region-as-kill beg (point)))) - (defun avy-kill-in-line () + (defun avy-copy-as-kill-in-line () (interactive) (avy-goto-char-timer) (let ((beg (point))) @@ -33,12 +40,12 @@ :bind ("C-'" . avy-goto-char-timer) ("C-;" . avy-goto-char-in-line) + ("C-#" . avy-goto-word-1) ("C-c C-'" . avy-copy-as-kill) ("C-c C-;" . avy-copy-as-kill-in-line)) (use-package casual-avy - :ensure t - :bind ("C-M-;" . casual-avy-tmenu)) + :bind ([control-bracketleft] . casual-avy-tmenu)) (use-package smartscan :custom (smartscan-symbol-selector "symbol") @@ -72,7 +79,8 @@ Or remove all highlighted symbols in the current buffer (with`ARG')." :bind ("C-c o" . symbol-overlay-put-or-clear) ("M-N" . symbol-overlay-switch-forward) - ("M-P" . symbol-overlay-switch-backward)) + ("M-P" . symbol-overlay-switch-backward) + (:map symbol-overlay-map ("o" . symbol-overlay-put-or-clear))) (use-package gumshoe :after perspective @@ -85,16 +93,7 @@ Or remove all highlighted symbols in the current buffer (with`ARG')." (gumshoe-slot-schema '(perspective time buffer position line)) :config (global-gumshoe-mode +1) - (defvar gumshoe-repeat-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "}") #'global-gumshoe-backtracking-mode-forward) - (define-key map (kbd "{") #'global-gumshoe-backtracking-mode-back) - map)) - (dolist (cmd '(global-gumshoe-backtracking-mode-forward global-gumshoe-backtracking-mode-back)) - (put cmd 'repeat-map 'gumshoe-repeat-map)) :bind - ("C-c }" . global-gumshoe-backtracking-mode-forward) - ("C-c {" . global-gumshoe-backtracking-mode-back) ("C-c '" . gumshoe-peruse-in-persp)) (use-package goto-chg |