Do nothing. This command is useful for disabling a specific mapping. :map <C-n> <Nop> will prevent <C-n> from doing anything.
Key mappings, abbreviations, and user-defined commands.
The key mapping commands can be used to either redefine the standard key bindings or define new ones. A mapping consists of a key, or sequence of keys, which are translated to a string of characters. Example:
will echo the current date to the command line when <F2> is pressed.
There are separate key mapping tables for each of the Normal, Insert, and Command-line modes.
Please note that, unlike Vim and other applications, mappings containing the Shift key are specified with the capital letter, so e.g. <C-n> is different from <C-N>, the latter being the only way to map Shift-Ctrl-n.
:map-special-chars
<Nop>
Do nothing. This command is useful for disabling a specific mapping. :map <C-n> <Nop> will prevent <C-n> from doing anything.
<CR> map_return
Expand to a line terminator in a key mapping. An Ex command in the {rhs} of a mapping requires a line terminator after it so that it is executed when the mapping is expanded. <CR> should be used for this purpose.
<Leader> mapleader
Expands to the value of the "mapleader" variable in key mapping. If
"mapleader" is unset or empty then "\" is used. Example:
:map <Leader>h :echo "Hello"<CR>
works like
:map \h :echo "Hello"<CR>
but after
let mapleader = ","
it works like
:map ,h :echo "Hello"<CR>
:map
Map the key sequence {lhs} to {rhs}. The {rhs} is remapped, allowing for nested and recursive mappings.
Warning: Mappings are NOT saved between sessions, make sure you put them in your vimperatorrc file!
:cm :cmap
Map the key sequence {lhs} to {rhs} (in Command-line mode). The {rhs} is remapped, allowing for nested and recursive mappings.
Warning: Mappings are NOT saved between sessions, make sure you put them in your vimperatorrc file!
:im :imap
Map the key sequence {lhs} to {rhs} (in Insert mode). The {rhs} is remapped, allowing for nested and recursive mappings.
Warning: Mappings are NOT saved between sessions, make sure you put them in your vimperatorrc file!
:mapc :mapclear
:cmapc :cmapclear
:imapc :imapclear
:no :noremap
Map the key sequence {lhs} to {rhs}. No remapping of the {rhs} is performed.
:cno :cnoremap
Map the key sequence {lhs} to {rhs} (in Command-line mode). No remapping of the {rhs} is performed.
:ino :inoremap
Map the key sequence {lhs} to {rhs} (in Insert mode). No remapping of the {rhs} is performed.
:map-<silent>
When the first argument to one of the mapping commands is <silent>, {rhs} is not echoed to the command line, nor, for that matter, anything else until the command has completed.
:unm :unmap
Remove the mapping of {lhs}.
:cunm :cunmap
Remove the mapping of {lhs} (in Command-line mode).
:iunm :iunmap
Remove the mapping of {lhs} (in Insert mode).
Vimperator can automatically replace words identified as abbreviations, which may be used to save typing or to correct commonly misspelled words. An abbreviation can be one of three types that are defined by the types of constituent characters. Whitespace and quotes are non-keyword types, and all other characters are keyword types.
A "full-id" abbreviation consists entirely of keyword characters (e.g., "teh", "msoft").
An "end-id" abbreviation ends in keyword character but otherwise contains all non-keyword characters (e.g., "'i").
A "non-id" abbreviation ends in a non-keyword character but otherwise contains any non-whitespace character (e.g., "def'").
Strings that cannot be abbreviations include "a'b" and "a b".
An abbreviation is recognized when a space, quote character, or <C-]> is typed after the abbreviation. There are no default abbreviations, and abbreviations are never recursive.
:ab :abbreviate
Abbreviate a key sequence. Abbreviate {lhs} to {rhs}. If only {lhs} is given, list all abbreviations that start with {lhs}. If no arguments are given, list all abbreviations.
:ca :cabbrev
Abbreviate a key sequence for Command-line mode. Same as :ab[breviate], but for Command-line mode only.
:ia :iabbrev
Abbreviate a key sequence for Insert mode. Same as :ab[breviate] but for Insert mode only.
:una :unabbreviate
Remove an abbreviation.
:cuna :cunabbrev
Remove an abbreviation for Command-line mode. Same as :una[bbreviate], but for Command-line mode only.
:iuna :iunabbrev
Remove an abbreviation for Insert mode. Same as :una[bbreviate] but for Insert mode only.
:abc :abclear
Remove all abbreviations.
:cabc :cabclear
Remove all abbreviations for Command-line mode.
:iabc :iabclear
Remove all abbreviations for Insert mode.
:com :command
List all user-defined commands.
List all user-defined commands that start with {cmd}.
Define a new user command. The name of the command is {cmd} and its replacement text is {rep}. The command's attributes are {attr}. If a command with this name already exists an error is reported unless [!] is specified, in which case the command is redefined. Unlike Vim, the command may start with a lowercase letter.
The command's behavior can be specified by providing attributes when the command is defined.
E175 E176 :command-nargs
Argument handling
By default user commands accept no arguments. This can be changed by specifying the -nargs attribute.
The valid values are:
-nargs=0 | No arguments are allowed (default) |
-nargs=1 | One argument is allowed |
-nargs=* | Zero or more arguments are allowed |
-nargs=? | Zero or one argument is allowed |
-nargs=+ | One or more arguments are allowed |
E180 E181 :command-complete
Argument completion
Completion for arguments to user defined commands is not available by default. Completion can be enabled by specifying one of the following arguments to the -complete option when defining the command.
altstyle | alternate author style sheets |
bookmark | bookmarks |
buffer | buffers |
color | color schemes |
command | Ex commands |
dialog | Firefox dialogs |
dir | directories |
environment | environment variables |
event | autocommand events |
file | files |
help | help tags |
highlight | highlight groups |
javascript | JavaScript expressions |
macro | named macros |
mapping | user mappings |
menu | menu items |
option | Vimperator options |
preference | Firefox preferences |
search | search engines and keywords |
shellcmd | shell commands |
sidebar | sidebar panels |
url | URLs |
usercommand | user commands |
custom,{func} | custom completion, provided by {func} |
E467 E468 :command-completion-custom
Custom completion
Custom completion can be provided by specifying the "custom,{func}" argument to -complete. The {func} is called with two arguments, a completion context, and an object describing the command's arguments. It should set the context's 'completions' property, or return an object, with 'items' and 'start' properties, describing the completions and where the replacement is to start.
start is the index into the word being completed at which the returned values should be applied and completions is a two dimensional array of the form: [[arg1, description1], [arg2, description2], …]
E177 E178 :command-count
Count handling
By default user commands do not accept a count. Use the -count attribute if you'd like to have a count passed to your user command. This will then be available for expansion as <count> in the argument.
:command-bang
Special cases
By default a user command does not have a special version, i.e. a version executed with the ! modifier. Providing the -bang attribute will enable this and <bang> will be available in the argument.
:command-replacement-text
Replacement text
The replacement text {rep} is scanned for escape sequences and these are replaced with values from the user-entered command line. The resulting string is then executed as an Ex command.
The valid escape sequences are:
<args> | The command arguments exactly as supplied |
<count> | Any supplied count, e.g. 5 |
<bang> | ! if the command was executed with the ! modifier |
<lt> | A literal '<' character to allow for a literal copy of one of the escape sequences. E.g. <lt>args> will expand to a literal <args> |
"q-" can be prefixed to the escape sequence so that the value is quoted, making it suitable for expression evaluation. Example: <q-args>
:comc :comclear
Delete all user-defined commands.
:delc :delcommand
Delete the user-defined command {cmd}.
Add a :Google command to search via google: