used to set the cursor position.
The |sandbox| is used for evaluating the expression to avoid
nasty side effects.
Example: >
:cmap <F7> <C-\>eAppendSome()<CR>
:func AppendSome()
:let cmd = getcmdline() .. " Some()"
:" place the cursor on the )
:call setcmdpos(strlen(cmd))
:return cmd
:endfunc
< This doesn't work recursively, thus not when already editing
an expression. But it is possible to use in a mapping.
*c_CTRL-Y*
CTRL-Y When there is a modeless selection, copy the selection into
the clipboard.
If there is no selection CTRL-Y is inserted as a character.
See 'wildmenu' for behavior during wildmenu completion mode.
*c_CTRL-Z*
CTRL-Z Trigger 'wildmode'. Same as 'wildcharm', but always available.
CTRL-M or CTRL-J *c_CTRL-M* *c_CTRL-J* *c_<NL>* *c_<CR>* *c_CR*
<CR> or <NL> start entered command
CTRL-[ *c_CTRL-[* *c_<Esc>* *c_Esc*
<Esc> When typed and 'x' not present in 'cpoptions', quit
Command-line mode without executing. In macros or when 'x'
present in 'cpoptions', start entered command.
Note: If your <Esc> key is hard to hit on your keyboard, train
yourself to use CTRL-[.
*c_META* *c_ALT*
ALT (|META|) may act like <Esc> if the chord is not mapped.
For example <A-x> acts like <Esc>x if <A-x> does not have a
command-line mode mapping.
*c_CTRL-C*
CTRL-C quit command-line without executing
*c_<Up>* *c_Up*
<Up> recall older command-line from history, whose beginning
matches the current command-line (see below). See 'wildmenu'
for behavior during wildmenu completion mode.
*c_<Down>* *c_Down*
<Down> recall more recent command-line from history, whose beginning
matches the current command-line (see below). See 'wildmenu'
for behavior during wildmenu completion mode.
*c_<S-Up>* *c_<PageUp>*
<S-Up> or <PageUp>
recall older command-line from history
*c_<S-Down>* *c_<PageDown>*
<S-Down> or <PageDown>
recall more recent command-line from history
CTRL-D command-line completion (see |cmdline-completion|)
'wildchar' option
command-line completion (see |cmdline-completion|)
CTRL-N command-line completion (see |cmdline-completion|)
CTRL-P command-line completion (see |cmdline-completion|)
CTRL-A command-line completion (see |cmdline-completion|)
CTRL-L command-line completion (see |cmdline-completion|)
*c_CTRL-^*
CTRL-^ Toggle the use of language |:lmap| mappings and/or Input
Method.
When typing a pattern for a search command and 'imsearch' is
not -1, VAL is the value of 'imsearch', otherwise VAL is the
value of 'iminsert'.
When language mappings are defined:
- If VAL is 1 (langmap mappings used) it becomes 0 (no langmap
mappings used).
- If VAL was not 1 it becomes 1, thus langmap mappings are
enabled.
When no language mappings are defined:
- If VAL is 2 (Input Method is used) it becomes 0 (no input
method used)
- If VAL has another value it becomes 2, thus the Input Method
is enabled.
These language mappings are normally used to type characters
that are different from what the keyboard produces. The
'keymap' option can be used to install a whole number of them.
When entering a command line, langmap mappings are switched
off, since you are expected to type a command. After
switching it on with CTRL-^, the new state is not used again
for the next command or Search pattern.
*c_CTRL-]*
CTRL-] Trigger abbreviation, without inserting a character.
For Emacs-style editing on the command-line see |emacs-keys|.
The <Up> and <Down> keys take the current command-line as a search string.
The beginning of the next/previous command-lines are compared with this
string. The first line that matches is the new command-line. When typing
these two keys repeatedly, the same string is used again. For example, this
can be used to find the previous substitute command: Type ":s" and then <Up>.
The same could be done by typing <S-Up> a number