Better word selections

Because we all have these tricked-out kakrcs with hidden gems inside.

I’ll start with this one:

map global normal w     <a-i>w                #select word
map global normal <a-w> <a-i><a-w>            #select WORD
map global normal W     '"_s.<ret><a-i>w'     #subselect words from current selection
map global normal <a-W> '"_s.<ret><a-i><a-w>' #subselect WORDS

which repurposes w into a word selection mapping.

My reasoning is that the difference between default e and w is too subtle to warrant having both mappings, and I was never able to tell which I need in which circumstances anyway. So now I only move by words using e and b, which are symmetrical anyway.
I also think selecting the current word is an incredibly common thing to do, and it deserves a better mapping than the awkward <a-i>w

1 Like

I have something similar in my Clojure mode… My only problem is that I seem to use w in the case when I want to delete leading whitespace, e.g.:

   |    thing2

What do you do in this case?