# There is no timeout on option

According to: this wiki &

:help timeout


in vim when I set this option:

 set notimeout ttimeout ttimeoutlen=200


It should set a keycode timeout in 200ms when I add this in my .vimrc file But the problem is it doesn't work for me anyway (it doesn't set keycode timeout). So is it working right? Or I can't feel it? Please let me know why it happens and how can I fix that.

OS: Fedora 26
Terminal: Gnome-terminal 3.24.2 Using VTE version 0.48.4 +GNUTLS
Vim version: VIM - Vi IMproved 8.0

• Hi there, please provide type and version of OS, terminal and vi/vi clone used. Please provide the result with vim -u NONE – mike Nov 13 '17 at 19:20
• I tried to enter that option in <vim -u NONE> but it seems it doesn't work or maybe my definition of timeout is different. You know I think when I add that option, vim should give a timeout for those keycodes that made of two characters (for example when I want to delete a whole line with dd I should enter them continuous thus when I enter them separately (with a delay) vim shouldn't delete that line)). Is it true? – Cy8099 Nov 13 '17 at 19:41

You're mistaken about what the documentation is referring to when it mentions key codes.

dd is not a key code. It is a just a vim command comprised of two key strokes.

An example of a key code would be ^[[D (alternatively notated as as <Esc>[D), which is what the terminal sends when you press the Left arrow.

The key code timeout is intended to allow Vim to handle such sequences differently when they are typed in (which occurs more slowly than when the terminal sends them), allowing you to, for example, type Esc[D to leave insert mode and then display macro definitions of the macro under the cursor, but also to press the left arrow to move one character to the left in insert mode, even though those two operations result in the same sequence of characters being passed from the terminal to Vim.

As dd is a built-in command, it never times out. However, you can use the timeout/timeoutlen (not ttimeout/ttimeoutlen) settings to cause mappings to time out.

e.g.

Try the following:

:set timeout timeoutlen=1000 " These are the defaults
:nnoremap xd dd


Press xd. It will delete a line.

Now just press x. Nothing will happen for one second: Vim is waiting to see whether you are typing the xd mapping. Then, after one second, the mapping will time out, and a single character will be deleted.

set timeoutlen=200