Visual mode is what Vim calls it when you’re making a visual selection. It doesn’t matter if you’re defining the selection with a mouse or the keyboard, it’s still called “Visual” mode.
Plain Visual Mode
When you click-drag on some text in a modern editor you are creating a “visual selection”. We tend to just say “selection” because everything is “visual” in a modern editor, and it would be a meaningless redundancy. Since most people didn’t have mice when Vim was created, the distinction wasn’t meaningless, and it still isn’t when you use Vim on the terminal.
When you’re starting out, click-dragging to select text is a great way to do it. You’re familiar with it, and it works as long as you’re using a Graphical Vim client like MacVim.
Eventually, most Vim converts start looking for ways to do things without having to stop and reach for a mouse, and you don’t have a choice when you’re working in the terminal.
To create a visual selection without the mouse you start by typing
Lower case v switches you into Visual mode and selects the character the cursor
is on. Upper case V switches you into Visual mode and selects the line the
cursor is on. Both forms of visual selection can be expanded using the arrow
keys, mouse, or any other movement command.
This is useful when you want to move an entire function, or in the case of this book, a paragraph. To do this I would place the cursor at the top, or bottom, of the paragraph, enter visual mode, then tell the cursor to jump to the other end of the paragraph (see more movement), then cut it, and paste it in the new location (see cut, copy, paste).
In Graphical Vim clients you can be in a weird hybrid mode that’s one part
Insert and one part Visual. It shows up as
-- (insert) VISUAL -- when you
select some text with your mouse without first leaving Insert mode.
Everything works as you would expect it to, so it’s just an odd quirk.
Visual Block Mode
Visual block mode allows you to select any arbitrary rectangular selection in your document. Most of the time it’s not very useful, but when you’re editing something like a CSV file, it can be pretty awesome.Check out the Visual Block Mode page for more details.
I’m a big fan of the
What’s nice about this is you hit
v then just keep whacking it and the visual
selection expands outward from character, to word, to paragraph, etc.