elvis’s programming assistance capabilities are described in this section.
elvis provides commands that make it easier to stay within the editor while working on a program. You can recompile a single file, rebuild your entire program, and work through compiler errors one at a time. The elvis commands are summarized in Table 17-10.
Run the C compiler. Useful for recompiling an individual file.
Recompile everything that needs recompiling (usually via make).
Move to the next error’s location.
cc command recompiles
an individual source file. You run it from the colon command line.
For example, if you are editing the file hello.c and you type
:cc, elvis will compile hello.c for you.
If you supply additional arguments to the
:cc command, those arguments will be
passed on to the C compiler. In this case, you need to supply
all the arguments, including the
:cc command works by
executing the text of the
option. The default value is
($1?$1:$2)". elvis sets
$2 to the name of the current
source file, and
$1 to the
arguments you give to the
command. The value of
uses your arguments if they are present; otherwise, it just passes
the current file’s name to the system
cc command. (You can, of course, change
ccprg to suit your taste.)
:make command is intended to recompile everything ...