vim - 如何禁用 vim 主键上的超时?

标签 vim

当我在 vim 中按 d 时,我的状态栏显示 d并无限等待进一步的指令。

当我按下我的领导者(对我来说)时,它会等待输入一段时间然后超时。

如何禁用此功能,并让它无限期地等待进一步的指令?

最佳答案

来自 :help ttimeout :

                                'timeout' 'to' 'notimeout' 'noto'
'timeout' 'to'          boolean (default on)
                        global
                                                *'ttimeout'* *'nottimeout'*
'ttimeout'              boolean (default off)
                        global
                        {not in Vi}
        These two options together determine the behavior when part of a
        mapped key sequence or keyboard code has been received:

        'timeout'    'ttimeout'                action
           off          off                    do not time out
           on           on or off              time out on :mappings and key codes
           off          on                     time out on key codes

        If both options are off, Vim will wait until either the complete
        mapping or key sequence has been received, or it is clear that there
        is no mapping or key sequence for the received characters.  For
        example: if you have mapped "vl" and Vim has received 'v', the next
        character is needed to see if the 'v' is followed by an 'l'.
        When one of the options is on, Vim will wait for about 1 second for
        the next character to arrive.  After that the already received
        characters are interpreted as single characters.  The waiting time can
        be changed with the 'timeoutlen' option.
        On slow terminals or very busy systems timing out may cause
        malfunctioning cursor keys.  If both options are off, Vim waits
        forever after an entered <Esc> if there are key codes that start
        with <Esc>.  You will have to type <Esc> twice.  If you do not have
        problems with key codes, but would like to have :mapped key
        sequences not timing out in 1 second, set the 'ttimeout' option and
        reset the 'timeout' option.

        NOTE: 'ttimeout' is reset when 'compatible' is set.
来自评论:

Basically, ESC is a "leader" for arrows and other control sequences, so you might have to press ESC twice instead of once. – @Anton Kovalenko

Running set notimeout and set ttimeout solved my problems. – @nightcracker

关于vim - 如何禁用 vim 主键上的超时?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14737429/

相关文章:

bash - 在 vim 命令行模式下 : how to kill the line from the current cursor position to the end

vim - 如果 getKeyState 不起作用,自动热键将 alt+j 重新映射到左侧,但 alt+shift+j 不会选择左侧,也不会 alt+ctr+j 移动插入符号

Vimrc 在 cmap 中使用变量

windows - vimrc 跨平台并与 Dropbox 同步。

Vim 在葡萄牙语键盘布局中重新映射方括号

unix - 使 glob() 函数也匹配 Vim 中的隐藏点文件

vim - 如何在 vimrc 加载后运行 echo 语句?

vim - 为什么我在将 "set syntax"嵌入文件时遇到问题?

unix - 我应该学习什么Unix文本编辑器?

vim - 为什么 * (星号) 立即转到 vim 中的下一个事件?