I am looking at some plugin that happens to be configurable through a curious mapping (e.g. unite.vim):
More advanced configuration example:
>
" The prefix key.
nnoremap [unite] <Nop>
nmap f [unite]
nnoremap <silent> [unite]c :<C-u>UniteWithCurrentDir
\ -buffer-name=files buffer bookmark file<CR>
What does the [unite]
means ?
I understand that it stands for a custom leader/prefix only for the plugin, but what is it's meaning for Vim ?
f
in your example, it will be resolved to[unite]
(due to thenmap
), which in turn resolves to<Nop>
, i.e. nothing, but only after the map timeout, or if not followed by one of the defined combinations, such asc
, in which case it suddenly turns into[unite]c
, which resolves to the mapped command :) Basically,f
turns to nothing, butfc
turns to the mapped command.[unite]
is just a convenient placeholder, you can use other text if you want. Vim won't interpret its characters individually.[
square bracket]
? Does they means "treats this as one symbol" ?nnoremap myprefix <nop>
and then usingmyprefix
anywhere ? or using{}
instead ?[unite]
could affect a map defined in the same buffer, made from its first letters (e.g.[u
) in that Vim will now wait to see if you typen
after it, or not.