2013-02-06 36 views
10

Khi tôi nhấn d trong vim dòng trạng thái của tôi, hãy nói d và chờ vô hạn để được hướng dẫn thêm.Làm thế nào để vô hiệu hóa thời gian chờ trên phím lãnh đạo vim?

Khi tôi nhấn trưởng nhóm của mình (, đối với tôi), nó chờ đầu vào một lúc rồi sau đó hết giờ.

Làm cách nào để vô hiệu hóa chức năng này và làm cho nó chờ đợi vô thời hạn để được hướng dẫn thêm?

+1

': help 'ttimeout'' có thể hữu ích. –

+0

@AntonKovalenko: có bất kỳ tác dụng phụ nào mà tôi phải biết khi xóa thời gian chờ không? Ngoài ra, sự khác biệt giữa 'timeout' và' ttimeout' không rõ ràng với tôi, sau khi đọc trang trợ giúp. – orlp

+0

Về cơ bản, ESC là một "người dẫn đầu" cho các mũi tên và các chuỗi điều khiển khác, vì vậy bạn có thể phải nhấn ESC hai lần thay vì một lần. (Có thể có một số cách xung quanh nó, nhưng tôi quá lười biếng để đọc thêm - đó là lý do tại sao tôi chỉ đưa ra một gợi ý thay vì gửi câu trả lời) –

Trả lời

10

Từ :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. 

Từ nhận xét:

Về cơ bản, ESC là một "lãnh đạo" cho mũi tên và trình tự kiểm soát khác, vì vậy bạn có thể phải nhấn ESC hai lần thay vì một lần . - @Anton Kovalenko

Chạy set notimeoutset ttimeout giải quyết được sự cố của tôi. - @nightcracker

+1

Có thể bạn cung cấp một số giải thích về lý do tại sao tốt hơn là đặt thời gian chờ thay vì hết giờ hoặc thời gian chờ, vui lòng? – aturegano

Các vấn đề liên quan