Last active
September 20, 2018 07:30
-
-
Save hlissner/4960fe3732c41e48d112 to your computer and use it in GitHub Desktop.
Make ace-jump do a two-char search (like vim-sneak)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Thanks to: https://github.com/winterTTr/ace-jump-mode/issues/23 | |
(defun ace-jump-two-chars-mode (&optional query-char query-char-2) | |
"AceJump two chars mode" | |
(interactive) | |
(evil-half-cursor) | |
(setq query-char (or query-char (read-char ">"))) | |
(setq query-char-2 (or query-char-2 (read-char (concat ">" (string query-char))))) | |
(if (eq (ace-jump-char-category query-char) 'other) | |
(error "[AceJump] Non-printable character")) | |
;; others : digit , alpha, punc | |
(setq ace-jump-query-char query-char) | |
(setq ace-jump-current-mode 'ace-jump-char-mode) | |
(ace-jump-do (regexp-quote (concat (char-to-string query-char) | |
(char-to-string query-char-2))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment