vim Vi IMproved: a visual text-selection mode,
moving the cursor to places without text (yet), incrementing and
decrementing numbers, storing editing commands in registers,
handling binary files and different end-of-line styles, line
breaking, and screen scrolling.
Take a look at a few of the
powerful new features that make vim Vi IMproved: a visual text-selection mode,
moving the cursor to places without text (yet), incrementing and
decrementing numbers, storing editing commands in registers,
handling binary files and different end-of-line styles, line
breaking, and screen scrolling.
This month, let’s wrap up the series about a few of the powerful new features that make vimVi IMproved: a visual text-selection mode, moving the cursor to places without text (yet), incrementing and decrementing numbers, storing editing commands in registers, handling binary files and different end-of-line styles, line breaking, and screen scrolling.
As before, if you don’t have a .vimrc file in your home directory, you can enable the new features of vim features by typing…
:set nocompatible
… after you launch the editor.
Visual Mode: Seeing Before Doing
Both original vi and vim can modify an area of text by following a “change” command, such as d for “delete,” with a motion command, like w for “word.” So, dw deletes the next word, and the command c/The dog would change all text from the current cursor position up to but not including the next occurrence of The dog.
While expressive and useful, such commands work invisibly — that is, you can’t see which text will be modified until you execute the command. Also, these commands only work on a contiguous string of characters; it’s hard to, say, delete the third column of a table or the sixth through the tenth characters on each of the next five lines. vim ’s visual mode makes editing easy. It highlights text to be modified. Once you’ve selected some text, type a…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: