complete
what example ~
- command :e<Tab>
- tag :ta scr<Tab>
- option :set sc<Tab>
- option value :set hf=<Tab>
- file name :e ve<Tab>
- etc.
If there are multiple matches, CTRL-N (next) and CTRL-P (previous)
will walk through the matches. <Tab> works like CTRL-N, but wraps
around to the first match.
The 'wildchar' option can be set to the character for command-line
completion, <Tab> is the default. CTRL-D can be typed after an
(incomplete) wildcard; all matches will be listed. CTRL-A will insert
all matches. CTRL-L will insert the longest common part of the
matches.
Insert-mode completion. |ins-completion|
In Insert mode the CTRL-N and CTRL-P keys can be used to complete a
word that appears elsewhere. |i_CTRL-N|
With CTRL-X another mode is entered, through which completion can be
done for:
|i_CTRL-X_CTRL-F| file names
|i_CTRL-X_CTRL-K| words from 'dictionary' files
|i_CTRL-X_CTRL-T| words from 'thesaurus' files
|i_CTRL-X_CTRL-I| words from included files
|i_CTRL-X_CTRL-L| whole lines
|i_CTRL-X_CTRL-]| words from the tags file
|i_CTRL-X_CTRL-D| definitions or macros
|i_CTRL-X_CTRL-O| Omni completion: clever completion
specifically for a file type
|i_CTRL-X_CTRL-R| contents from registers
etc.
Long line support. |'wrap'| |'linebreak'|
If the 'wrap' option is off, long lines will not wrap and only part
of them will be shown. When the cursor is moved to a part that is not
shown, the screen will scroll horizontally. The minimum number of
columns to scroll can be set with the 'sidescroll' option. The |zh|
and |zl| commands can be used to scroll sideways.
Alternatively, long lines are broken in between words when the
'linebreak' option is set. This allows editing a single-line
paragraph conveniently (e.g. when the text is later read into a DTP
program). Move the cursor up/down with the |gk| and |gj| commands.
Text formatting. |formatting|
The 'textwidth' option can be used to automatically limit the line
length. This supplements the 'wrapmargin' option of Vi, which was not
very useful. The |gq| operator can be used to format a piece of text
(for example, |gqap| formats the current paragraph). Commands for
text alignment: |:center|, |:left| and |:right|.
Extended search patterns. |pattern|
There are many extra items to match various text items. Examples:
A "\n" can be used in a search pattern to match a line break.
"x\{2,4}" matches "x" 2 to 4 times.
"\s" matches a white space character.
Directory, remote and archive browsing. |netrw|
Vim can browse the file system. Simply edit a directory. Move around
in the list with the usual commands and press <Enter> to go to the
directory or file under the cursor.
This also works for remote files over ftp, http, ssh, etc.
Zip and tar archives can also be browsed. |tar| |zip|
Edit-compile-edit speedup. |quickfix|
The |:make| command can be used to run the compilation and jump to the
first error. A file with compiler error messages is interpreted. Vim
jumps to the first error.
Each line in the error file is scanned for the name of a file, line
number and error message. The 'errorformat' option can be set to a
list of scanf-like strings to handle output from many compilers.
The |:cn| command can be used to jump to the next error.
|:cl| lists all the error messages. Other commands are available.
The 'makeef' option has the name of the file with error messages.
The 'makeprg' option contains the name of the program to be executed
with the |:make| command.
The 'shellpipe' option contains the string to be used to put the
output of the compiler into the errorfile.
Finding matches in files. |:vimgrep|
Vim can search for a pattern in multiple files. This uses the
advanced Vim regexp pattern, works on all systems and also works to
search in compressed files.
Improved