Last active
October 24, 2015 12:34
-
-
Save timcharper/c8d8bb01b3a13e5f68f4 to your computer and use it in GitHub Desktop.
Better evil word behavior
This file contains hidden or 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
(defun forward-evil-word (&optional count) | |
"" | |
(let ((init-point (point))) | |
(forward-symbol (or count 1)) | |
(if (= (point) init-point) | |
count 0))) | |
(setq evil-symbol-word-search t) |
I updated the gist; turns out there is a setting for evil to use symbol instead of words as the #/* searching; also, changing forward-evil-word to just use the implementation for forward-symbol gives even closer emulation to VIM (edit an emacs file and see that - is treated as a word character).
Digging this; short, sweet and accurate.
Actually, it turns out that my previous one was more accurate :/
evil-symbol-word-search
works for #/* searching, thanks!
Do you find that forward-symbol
actually does what you want for word movement? I find it jumping over places I expect w to stop, for example:
FOO_BAR = 1
With point on F
, pressing w jumps to 1
rather than stopping on =
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this, the new behaviour was really annoying me!