O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Visual and select mode

Vim's visual mode allows for an arbitrary selection of text (usually to perform some sort of operations on). It's useful when you want to work with a section of a file that does not map to an existing text objects (word, sentence, paragraph, and so on). There are three ways to enter visual mode:

  • v enters a character-wise visual mode (status line text: -- VISUAL --)

  • V enters a line-wise visual mode (status line text: -- VISUAL LINE --)

  • Ctrl enters a block-wise visual mode (status line text: -- VISUAL BLOCK --)

Once you enter visual mode, you are able to move your cursor using the usual movement commands, which would expand the selection. In the following example, we've entered a character-wise visual mode ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required