6

The question arise from a problem using a huge remapped configuration so bépo layout is virtually the same as the qwerty in normal mode, at least for single key press commands.

Selecting text using visual selection mode, then pressing i which is configured as noremap i d, it would be expected that the text would be immediately deleted. But it isn't immediately triggered, instead it's waiting for a possible second key.

Setting timeoutlen to zero will achieve the expected result in this context, but then a command like ,, which is configured as noremap ,, gg won't work anymore.

So is it possible to set timeout specific to one command, or in certain context like in visual selection mode with an active selection?

Maybe having timeoutlen turned to zero might make things like noremap ,, gg useless, so just removing this mapping might be enough to achieve the expected result.

  • How about setting it to a reasonable value, like, say 500? For the modes, AFAICT there autocmd events only for insert-mode-related events, so it might not be possible (unless you use CursorMoved and monitor for changes to modes, but that's error-prone and too much overhead). – muru Mar 2 '17 at 6:14
  • I have never used another keyboard layout, but since I have seen this before: What you mean with hugely remapped ? From this article on Dvorak (vim.wikia.com/wiki/Using_Vim_with_the_Dvorak_keyboard_layout) I get the guess, that it should work quite well with the langmap command (Except multibutton commands like <c-v>). Sorry if this is what you already have done. Like i said, never needed it, but I hope it may help you. – Doktor OSwaldo Mar 2 '17 at 8:55
  • I mean this mapping. – psychoslave Mar 2 '17 at 9:08
3

It sounds like you have something like

noremap i d
noremap ix ... other mappings starting with i

And you are asking that for i the timeout is 0.

In that case you would never be able to type any of the ix mappings - so why not just remove them and solve the problem this way?

If this is only for visual mode then avoid defining mappings that start with i for that mode.

You can remove the mappings you mentioned in the comments with

xunmap iM
xunmap im
  • Actually, the problem concern the visual selection mode, sorry for the error and thank you for you suggestions. – psychoslave Mar 3 '17 at 9:14
  • @psychoslave you can do :map i to see which mappings are defined for what modes. – laktak Mar 3 '17 at 19:52
  • x iM *@:<C-U>call <SNR>30_wrap_i('[[','][')<CR> o iM *@:<C-U>call <SNR>30_wrap_i('[[','][')<CR> x im *@:<C-U>call <SNR>30_wrap_i('[m',']M')<CR> o im *@:<C-U>call <SNR>30_wrap_i('[m',']M')<CR> i * d – psychoslave Mar 4 '17 at 7:38
  • 1
    Hard to read this way, you should update your question. x stands for visual mode - so you should remove the iM and im mappings. – laktak Mar 4 '17 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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