Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So far I've been trying to use Vim in as vanilla a configuration as possible, so as to save myself hassle when moving between machines. However, there are a few things I'd really like to bind keys, such as to shorten "_diwP which I use often to delete the word under the cursor and replace it with one from the clipboard. Are there any particular keys that are conventionally reserved for user-defined mappings? The point of this question is mostly that I would like to avoid hassle later on when I decide to install some plugin or take my configuration files to vim on another OS and find that my key mappings clash with something else.

share|improve this question
up vote 8 down vote accepted

All the letters are already taken: (broken link) (web archive - HTML) (plaintext)

But if I want permenant commands I use <leader> as a prefix.

:map <leader>l    :list!

The default leader is '\' so by typing \l I can switch the state of list.
Note the leader can be changed. See :help leader

Note: to make sure I have my vim mapping available anytime I want them, I just put the .vimrc file on a convenient webserver. Then I can just use wget (or a browser) to get my .vimrc file at any time.

share|improve this answer

All keys are safe to remap in Vim. However, there are two types of mappings: recursive and non recursive.

a) Recursive:

If you remap for example,

nmap x dd

x deletes the line instead of one character

you will have effectively lost the x key for future mappings, as well as overwritten the delete character function. Were sometime in the future some plugin depend on that key, that could present a problem.

For example,

nmap <C-x> xxx

will delete three lines instead of three characters, because it is effectively doing dddddd. This is a problem since effectively were some of your plugins to use the x (and they surely will) it will create problems (nasty ones).

b) Non recursive mapping

nnoremap x dd

solves that problem in a way that it will assign dd to x so that upon your pressing x you delete a line instead of a character, but any future mapping

nnoremap <C-x> xxx

will have the original x on the right hand side functionality.

Always use nnoremap, inoremap ... the non-recursive mapping instead of nmap, imap and so on ... unless you have a very strong reason for doing the opposite.

share|improve this answer

I have a french keyboard. I use é, è, à, ù, µ, §, £, ç ...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.