diff options
| author | tslil clingman <> | 2021-01-06 22:24:02 -0500 |
|---|---|---|
| committer | tslil clingman <> | 2021-01-06 22:24:02 -0500 |
| commit | bc53790e81035a507d5ea308743a8468b7fce7a0 (patch) | |
| tree | 18a774a000ad4050fc75356cbee620ba48309be6 /emacs/inits/14-movement.el | |
| parent | 6fddeab7525b8b284b5a22406a696894be89a307 (diff) | |
Using frog-jump-buffer
Diffstat (limited to 'emacs/inits/14-movement.el')
| -rw-r--r-- | emacs/inits/14-movement.el | 133 |
1 files changed, 47 insertions, 86 deletions
diff --git a/emacs/inits/14-movement.el b/emacs/inits/14-movement.el index eff69b3..c02990d 100644 --- a/emacs/inits/14-movement.el +++ b/emacs/inits/14-movement.el @@ -1,85 +1,38 @@ -;; Time-stamp: <2020-05-24 12:03:24 (tslil@bison)> +;; Time-stamp: <2021-01-06 22:22:59 (tslil@bison)> ;; ------------------------------------------------------------------- -;; Repeated key presses for region, deletion, and movement +;; Repeated key presses for region (use-package expand-region :ensure t :bind (("M-r" . er/expand-region)) :config (setq expand-region-fast-keys-enabled t - expand-region-contract-fast-key "c" - expand-region-reset-fast-key "e" - expand-region-autocopy-register "i")) - -(use-package viking-mode - :disabled - :after expand-region - :bind (:map viking-mode-map - ("C-d" . nil) - ("C-c d" . viking-kill-thing-at-point)) - :config - (setq viking-use-expand-region-when-loaded t - viking-really-delete nil) - (viking-global-mode)) - -;; (defun goto-begin-dwim () -;; "Read the source." -;; (interactive) -;; (let ((iter (viking-last-key-repeats)) -;; (lisp (memq major-mode '(emacs-lisp-mode -;; lisp-mode -;; scheme-mode -;; slime-repl-mode)))) -;; (if lisp -;; (cond -;; ((= iter 1) (back-to-indentation)) -;; ((= iter 2) (backward-sexp)) -;; ((= iter 3) (beginning-of-defun)) -;; (t (beginning-of-defun 1))) -;; (cond -;; ((= iter 1) (back-to-indentation)) -;; ((= iter 2) (beginning-of-line)) -;; ((= iter 3) (backward-paragraph)) -;; (t (goto-char (point-min))))))) - -;; (defun goto-end-dwim () -;; "Read the source." -;; (interactive) -;; (let ((iter (viking-last-key-repeats)) -;; (lisp (memq major-mode '(emacs-lisp-mode lisp-mode scheme-mode slime-repl-mode)))) -;; (if lisp -;; (cond -;; ((= iter 1) (end-of-line)) -;; ((= iter 2) (end-of-defun)) -;; (t (end-of-defun 1))) -;; (if (< (point) (point-at-eol)) (end-of-line) -;; (forward-paragraph))))) - -;; (global-set-key (kbd "C-a") 'goto-begin-dwim) -;; (global-set-key (kbd "C-e") 'goto-end-dwim) + expand-region-contract-fast-key "c" + expand-region-reset-fast-key "e" + expand-region-autocopy-register "i")) ;; ------------------------------------------------------------------- ;; Window switching (use-package switch-window :ensure t :bind (("C-x o" . switch-window) - ("C-x C-o" . other-frame) - ("C-c o" . switch-window) - ("C-c n" . switch-window-then-maximize) - :map switch-window-extra-map - ("u" . switch-window-mvborder-up) - ("e" . switch-window-mvborder-down) - ("n" . switch-window-mvborder-left) - ("o" . switch-window-mvborder-right) - ("i" . nil) - ("j" . nil) - ("k" . nil) - ("l" . nil)) + ("C-x C-o" . other-frame) + ("C-c o" . switch-window) + ("C-c n" . switch-window-then-maximize) + :map switch-window-extra-map + ("u" . switch-window-mvborder-up) + ("e" . switch-window-mvborder-down) + ("n" . switch-window-mvborder-left) + ("o" . switch-window-mvborder-right) + ("i" . nil) + ("j" . nil) + ("k" . nil) + ("l" . nil)) :config (setq switch-window-input-style 'minibuffer - switch-window-shortcut-style 'qwerty - switch-window-multiple-frames nil - switch-window-qwerty-shortcuts - '("a" "s" "t" "h" "n" "e" "o" "i" "d" "r" "w" "f" "u" "p"))) + switch-window-shortcut-style 'qwerty + switch-window-multiple-frames nil + switch-window-qwerty-shortcuts + '("a" "r" "s" "t" "n" "e" "i" "o"))) ;; ------------------------------------------------------------------- ;; Character jumping @@ -87,21 +40,29 @@ :ensure t :demand :bind (("C-," . avy-goto-char-timer) - ("C-." . avy-goto-char-in-line) - ("M-g s" . avy-goto-word-or-subword-1) - ("M-g w" . avy-goto-word-1) - ("M-g a" . avy-goto-word-0) - ("M-g M-g" . avy-goto-line)) + ("C-." . avy-goto-char-in-line) + ("M-g s" . avy-goto-word-or-subword-1) + ("M-g w" . avy-goto-word-1) + ("M-g a" . avy-goto-word-0) + ("M-g M-g" . avy-goto-line)) + :config + (setq avy-keys '(?a ?r ?s ?t ?g ?k ?n ?e ?i ?o ?q ?w ?f ?p) + avy-dispatch-alist '((?w . avy-action-kill-move) + (?W . avy-action-kill-stay) + (?j . avy-action-teleport) + (?m . avy-action-mark) + (?c . avy-action-copy) + (?y . avy-action-yank) + (?i . avy-action-ispell) + (?z . avy-action-zap-to-char)))) + +(use-package frog-jump-buffer + :ensure t + :bind (("M-SPC" . frog-jump-buffer)) :config - (setq avy-keys '(?a ?s ?t ?h ?n ?e ?o ?i ?d ?r ?u ?p) - avy-dispatch-alist '((?w . avy-action-kill-move) - (?W . avy-action-kill-stay) - (?j . avy-action-teleport) - (?m . avy-action-mark) - (?c . avy-action-copy) - (?y . avy-action-yank) - (?i . avy-action-ispell) - (?z . avy-action-zap-to-char)))) + (setq frog-menu-avy-keys '(?a ?r ?s ?t ?g ?k ?n ?e ?i ?o ?' + ?q ?w ?f ?p ?b ?j ?l ?u ?y ?\; + ?z ?x ?c ?d ?v ?m ?h ?, ?.))) ;; ------------------------------------------------------------------- ;; General stuff @@ -118,16 +79,16 @@ (global-set-key (kbd "M-p") 'scroll-down-command) (global-set-key (kbd "C-S-n") - (lambda () (interactive) (ignore-errors (forward-line 5)))) + (lambda () (interactive) (ignore-errors (forward-line 5)))) (global-set-key (kbd "C-S-p") - (lambda () (interactive) (ignore-errors (forward-line -5)))) + (lambda () (interactive) (ignore-errors (forward-line -5)))) (global-set-key (kbd "C-S-f") - (lambda () (interactive) (ignore-errors (forward-char 5)))) + (lambda () (interactive) (ignore-errors (forward-char 5)))) (global-set-key (kbd "C-S-b") - (lambda () (interactive) (ignore-errors (backward-char 5)))) + (lambda () (interactive) (ignore-errors (backward-char 5)))) ;; Hardcore mode (defconst hardcore-nav-mode t) |
