Programming Assistance

vi was developed primarily as a programmer’s editor. It has features that make things especially easy for the traditional-style Unix programmer—someone writing C programs and troff documentation. (Real programmers write real documentation in troff.) Several of the clones are proud bearers of this tradition, adding a number of features that make them even more usable and capable for the “power user.”[44]

Two features (among many) most deserve discussion:

Edit-compile speedup

elvis, Vim, and vile allow you to easily invoke make, capture the errors from your compiler, and automatically move to the lines containing the errors. You can then fix the errors and rerun make, all from within the editor.

Syntax highlighting

elvis, Vim, and vile have the ability to highlight and/or change the color of different syntactic elements in different kinds of files.

Edit-Compile Speedup

Programming often consists of an “edit-compile-debug” cycle. You make changes, compile the new code, and then test and debug it. When learning a new language, syntax errors are especially common, and it is frustrating to be constantly stopping and restarting (or suspending and resuming) the editor in between compiles.

elvis, Vim, and vile all provide facilities that allow you to stay within the editor while compiling your program. Furthermore, they capture the compiler’s output and use it to automatically go to each line that contains an error.[45] Consistent use of this capability can save time and ...

Get Learning the vi and Vim Editors, 7th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.