2013-02-06 7 views
10

Po naciśnięciu klawisza d w vim moja linia stanu mówi d i czeka w nieskończoność na dalsze instrukcje.Jak wyłączyć limit czasu na kluczu lidera vim?

Kiedy naciskasz mojego lidera (, dla mnie), czeka na wejście przez chwilę, a następnie limit czasu.

Jak mogę wyłączyć tę funkcję i sprawić, aby oczekiwała w nieskończoność na dalsze instrukcje?

+1

': help 'ttimeout'' może być przydatne. –

+0

@AntonKovalenko: czy są jakieś efekty uboczne, które muszę znać podczas usuwania limitu czasu? Również rozróżnienie pomiędzy 'timeout' i' ttimeout' nie jest dla mnie jasne po przeczytaniu strony pomocy. – orlp

+0

Zasadniczo ESC jest "liderem" dla strzałek i innych sekwencji kontrolnych, więc może być konieczne dwukrotne naciśnięcie klawisza ESC zamiast jednokrotnego. (Może być na to jakiś sposób, ale jestem zbyt leniwy, by czytać dalej - dlatego właśnie dałem wskazówkę zamiast zamieszczania odpowiedzi) –

Odpowiedz

10

Od :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. 

Z uwag:

Zasadniczo ESC jest „liderem” za strzałkami i innych sekwencji sterujących, więc może trzeba nacisnąć ESC dwa razy zamiast raz . - @Anton Kovalenko

Uruchamianie set notimeout i set ttimeout rozwiązało moje problemy. - @noccracker

+1

Czy możesz podać jakieś wyjaśnienie, dlaczego lepiej ustawić Ttimeout zamiast Timeout lub Timeoutlen, proszę? – aturegano