Which is the shortest way to select an entire line without the new line character in VIM?
I know that SHIFT + v selects the entire line
Adding on to the answer by @glts, you can replicate the functionality of the textobj-line plugin using only vanilla vim mappings, no plugin installation required.
To do so, add the following to your .vimrc
vnoremap al :normal 0v$h
omap al :normal val
vnoremap il :normal ^vg_
omap il :normal vil
The al
text object (short for 'a line') includes all characters in a line, but not the terminating newline. This includes all white space.
The il
text object (short for 'inside line') goes from the first non-blank character to the last non-blank character.
Commands such as yil
,val
, and cil
work as expected.