I'm looking to map Ctrl-N
to lbvhe
in normal mode. This should visually select the word under the cursor, and works fine unless the word is at the beginning of a line.
Having investigated, I've found that – in a mapping – firing h
when the cursor is in column 1 (which should simply do nothing) "traps" the cursor at the beginning of the line. Any following movement commands seem to be ignored; j
, k
, l
, e
, and w
all do nothing.
My mapping works perfectly on any word preceded by whitespace or punctuation, but not words preceded by the previous line's EOL.
:h motion.txt
will blow your mind.