- You can instruct vi to ignore case by typing
:set ic.
- A simple
:sis the same as:s//~/.
:&is the same as:s. You can follow the&withgto make the substitution globally on the line, and even use it with a line range.
- You can use the & key as a vi command to perform the
:&command, i.e., to repeat the last substitution.
- The
:~command is similar to the:&command, but with a subtle difference. The search pattern used is the last regular expression used in any command, not necessarily the one used in the last substitute command.
- Besides the
/character, you may use any nonalphanumeric, nonwhitespace character as your delimiter, except backslash, double quote, and the vertical bar (\,", and|).
- When the
edcompatibleoption is enabled, vi remembers the flags (gfor global andcfor confirmation) used on the last substitution and applies them to the next one.
Many Unix, Linux, and Mac OS X geeks enjoy using the powerful, platform-agnostic text editors vi and Vim, but there are far too many commands for anyone to remember. Author Arnold Robbins has chosen the most valuable commands for vi, Vim, and vi's main clones—vile, elvis, and nvi—and packed them into this easy-to-browse pocket reference. You'll find commands for all kinds of editing tasks, including programming, modifying system files, writing and marking up articles, and more.




Help






