Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I'm editing a lot of tex files using vim, and therefore I use the \ character a lot. Yet, when inserting a \ in insert mode, vim pauses the cursor on the same spot for one second, unlike with any other character.

Of course I don't have to physically wait for one whole second, I can just keep on typing, yet the text is only inserted after this second.

I found that I can create similar behavior by mapping e.g.:

inoremap ;; <esc>:
inoremap jj <esc>

etc. It seems as if vim is expecting another character to follow, so it can evaluate the map.

Unsetting \ as the mapleader doesn't alleviate the problem though, which is what I expected.

Also, I don't know if this is related, but using <esc> in insert mode doesn't work instantly (again because vim expects something to come after).

Is there a vim setting that let's me put the paste time to 0, yet I still want to be allowed to use my mappings ;;, jj and <esc>.

I know about timeout yet this doesn't help. If I do timeoutlen=0 none of the multi-key mappings would be useable.

share|improve this question
up vote 0 down vote accepted

You've identified the problem: \ is being used as the first character of an imap. To find out where it is being set you can execute

:verbose imap \

I don't have any solution other than to eliminate the mapping or unmap it when you're editing TeX files. You can do that by putting a line like this in a file named ~/.vim/after/ftplugin/tex.vim on Unix or ~\vimfiles\after\ftplugin\tex.vim on Windows:

silent! iunmap \x

where you would replace x by the corresponding part of the offending mapping.

I use LaTeX a little, have the Vim-LaTeX-Suite installed, and do not see that behavior, so at least it's not a problem with that suite.

share|improve this answer

It looks like you have an insert mode mapping starting with "\", possibly set by a plugin you have recently installed. To find if you do, and what file created the mapping(s), run this command:

:verbose imap \
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .