Completion is context-sensitive. It works like on the Command-line. It
completes an Ex command as well as its arguments. This is useful when writing
a Vim script.
*i_CTRL-X_CTRL-V*
CTRL-X CTRL-V Guess what kind of item is in front of the cursor and
find the first match for it.
Note: When CTRL-V is mapped you can often use CTRL-Q
instead of |i_CTRL-Q|.
CTRL-V or
CTRL-N Search forwards for next match. This match replaces
the previous one.
CTRL-P Search backwards for previous match. This match
replaces the previous one.
CTRL-X CTRL-V Further use of CTRL-X CTRL-V will do the same as
CTRL-V. This allows mapping a key to do Vim command
completion, for example: >
:imap <Tab> <C-X><C-V>
Completing contents from registers *compl-register-words*
*i_CTRL-X_CTRL-R*
CTRL-X CTRL-R Guess what kind of item is in front of the cursor from
all registers and find the first match for it.
Further use of CTRL-R (without CTRL-X) will insert the
register content, see |i_CTRL-R|.
'ignorecase' applies to the matching.
CTRL-N Search forwards for next match. This match replaces
the previous one.
CTRL-P Search backwards for previous match. This match
replaces the previous one.
CTRL-X CTRL-R Further use of CTRL-X CTRL-R will copy the line
following the previous expansion in other contexts
unless a double CTRL-X is used (e.g. this switches
from completing register words to register contents).
User defined completion *compl-function*
Completion is done by a function that can be defined by the user with the
'completefunc' option. See below for how the function is called and an
example |complete-functions|.
*i_CTRL-X_CTRL-U*
CTRL-X CTRL-U Guess what kind of item is in front of the cursor and
find the first match for it.
CTRL-U or
CTRL-N Use the next match. This match replaces the previous
one.
CTRL-P Use the previous match. This match replaces the
previous one.
Omni completion *omnicompletion* *compl-omni*
Completion is done by a function that can be defined by the user with the
'omnifunc' option. This is to be used for filetype-specific completion.
See below for how the function is called and an example |complete-functions|.
For remarks about specific filetypes see |compl-omni-filetypes|.
More completion scripts will appear, check www.vim.org. Currently there is a
first version for C++.
*i_CTRL-X_CTRL-O*
CTRL-X CTRL-O Guess what kind of item is in front of the cursor and
find the first match for it.
CTRL-O or
CTRL-N Use the next match. This match replaces the previous
one.
CTRL-P Use the previous match. This match replaces the
previous one.
Spelling suggestions *compl-spelling*
A word before or at the cursor is located and correctly spelled words are
suggested to replace it. If there is a badly spelled word in the line, before
or under the cursor, the cursor is moved to after it. Otherwise the word just
before the cursor is used for suggestions, even though it isn't badly spelled.
NOTE: CTRL-S suspends display in many Unix terminals. Use 's' instead. Type
CTRL-Q to resume displaying.
*i_CTRL-X_CTRL-S* *i_CTRL-X_s*
CTRL-X CTRL-S or
CTRL-X s Locate the word in front of the cursor and find the
first spell suggestion for it.
CTRL-S or
CTRL-N Use the next suggestion. This replaces the previous
one. Note that you can't use 's' here.
CTRL-P Use the previous suggestion. This replaces the
previous one.
Completing keywords from different sources *compl-generic*
*i_CTRL-N*
CTRL-N Find next match for words that start with the
keyword in front of the cursor, looking in places
specified with the 'complete' option. The found
keyword is inserted in front of the cursor.
*i_CTRL-P*
CTRL-P Find previous match for words that start with the
keyword in front of the cursor, looking in places
specified with the 'complete' option. The found