0

I use Vim and ideaVim(plugin in IDE) when coding. I have a lot of shared config, then I made both two linked from the one config file. Most of the time it is ok, but not when I map jj to <ESC>. it's normal in Vim, but I had to wait for a moment when typed 'j' in ideaVim.

A problem with mapping a sequence like jj is that Vim will pause whenever you type j in insert mode (it is waiting for the next key to determine whether to apply the mapping)

I tried to do like vmap <F12> ':imap jj <ESC><CR>', got failed. I also think about calling a function in need, but I don't know how to start. Anyone can give me a idea? Thanks in advance!

Feedforward
  • 4,521
  • 4
  • 22
  • 34
icew liu
  • 1
  • 1
  • 1
    Welcome to [so]! You’re question is a little unclear—does vim-emulation use your regular vimrc? When you say *used to mapping [sic] `` to `kj`*, do you mean you mapped `kj` to ``? Why you tried the vmap and what you expected it to do is also unclear—can you clarify that? Please [edit] your question to add these details. (While you’re at it, the StackExchange network prefers professionally-written questions; e.g., with proper capitalization of « i », spaces between sentences, etc. If english is not your first language, I’m happy to help edit for grammar and style.) – D. Ben Knoble Aug 25 '19 at 14:07
  • I can't find any references to the "vim-emulation" plug-in you talk about... Can you add more pointers about it? Such as URL for it, version, etc. Whatever you can find that can tell us more about what it is and does... Also, I assume by IDLE you're talking about the IDE that comes by default with Python, is that it? Please add more references to that as well (which one, version, URL if possible, etc.) Looks like the issue is regarding sharing `.vimrc`, can you perhaps configure one of the environments (IDLE possibly) to use a `.vimrc` from a different location? – filbranden Aug 25 '19 at 17:58
  • Thank for your valuable suggestions, I have resubmitted the question(This is my first time to ask for a question at stackoverflow in fact). I just want to complete the mapping when I need it, by shortcuts or other more efficient ways. – icew liu Aug 26 '19 at 13:14

1 Answers1

0

This delay is a normal behaviour for vim and IdeaVim. You have a map for jj, so if you enter the first j vim should wait a bit to recognize if it's just a regular j and it should be printed in buffer or this is a part of jj sequence. Usually it waits for 1 seconds for the next keystrokes.

This behaviour can be configured using timeout and timeoutlen options.

Feedforward
  • 4,521
  • 4
  • 22
  • 34
  • You did give me a idea, but that's not what I want most. The default timeout is just right for Vim. I want to know if there is a way to quickly complete this binding manually. – icew liu Aug 26 '19 at 14:35