If you have the following text:
line 1 line 2 line 3
You can hit CTRL+v on line 1 and hit j to select line 2. However, I want to select both line 1 and line 3, but not line 2.
Is this possible?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
:h visual-use (emphasis mine):
Using Visual mode consists of three parts:
- Mark the start of the text with "v", "V" or CTRL-V. The character under the cursor will be used as the start.
- Move to the end of the text. The text from the start of the Visual mode up to and including the character under the cursor is highlighted.
- Type an operator command. The highlighted characters will be operated upon.
You cannot exclude certain portions. Visual mode will select all of the text between the start and end of the selection. The only caveat is that block-wise visual mode will select a rectangle of text, rather than line by line up to and including the cursor.