Saturday, March 31, 2012

Re: CTRL-X keybindings in insert mode (e.g. ragtag.vim)

On 31/03/12 10:19, MikeM wrote:
> I recently downloaded Tim Pope's ragtag.vim (http://www.vim.org/scripts/script.php?script_id=1896) and note that most of the keybindings therein consist of CTRL-x, followed by another key (e.g. <C-x><CR> to create a pair of tags separated by a newline).
>
> One thing I've noticed is that if I type (in insert mode) CTRL-x and delay, say for a couple of seconds, the expected command invocations do not occur? I also not that, after such a delay, VIM displays a message in command buffer indicating that I'm in CTRL-x mode. Pressing any key, other than those listed in the command buffer message, results in the insertion of that character into the buffer as normal. This is perhaps to be expected as it accords with the description of CTRL-x mode in help, however, hitting CTRL-x and then a third key in rapid succession produces the desired result (i.e. ragtag.vim does what it's supposed to).
>
> Is this to be expected? Do others experience this?
>
>
>


Maybe a timeout could help you. See
:help 'timeout'
:help 'timeoutlen'
:help 'ttimeout'
:help 'ttimeoutlen'

The two -len settings are in milliseconds; the others are boolean. In
addition, if 'timeout' is on, 'ttimeout' is treated as on regardless of
its actual setting.

What I use (in my vimrc) is
set timeout timeoutlen=5000 ttimeoutlen=100

which means: timeout 5 seconds on mappings, 0.1 second on the bytes of a
multibyte keycode. Vary at will, depending on your typing speed and on
the speed of your keyboard interface; see the above-mentioned help tags
for details. (The default, which doesn't suit me, is 1 second on both
keycodes [too slow for me] and mappings [too fast for me].)


Best regards,
Tony.
--
... A booming voice says, "Wrong, cretin!", and you notice that you
have turned into a pile of dust.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: