As I understand, w
recognizes word boundaries by splitting text into 3 groups:
1) characters that are specified in the iskeyword
setting (alphabetic, digits, and underscore)
2) other non-printable characters (symbols)
3) whitespace characters
Each time you press w
it goes to the next group 1 or group 2. I'd like to customize it so it only goes to the next group 1, jumping over "symbol words".
What almost works is this:
nnoremap w /\k\+<CR>
which uses the iskeyword
character class \k
. But it is ugly because it simulates me performing a search, which changes my highlighting, clutters my search history, and who knows what else. Is there way to make this work "cleanly" like the w
command normally is?
I think you are looking for operator pending mode, a.k.a xmap, smap
and family.
I have done some examples of these in other answers on SO:
The most relevant example might be
You will also find some techniques that are similar and might be useful for you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With