5
मैं कुछ विस्क्रिप्ट लिखना चाहता हूं जो ट्रिम हो जाता है यदि विम सत्र एक निश्चित समय के लिए निष्क्रिय हो। क्या यह संभव है?विमस्क्रिप्ट: क्या निष्क्रिय समय के बाद की गई कार्रवाई के लिए कोई ऑटोकॉम्ड है?
मैं कुछ विस्क्रिप्ट लिखना चाहता हूं जो ट्रिम हो जाता है यदि विम सत्र एक निश्चित समय के लिए निष्क्रिय हो। क्या यह संभव है?विमस्क्रिप्ट: क्या निष्क्रिय समय के बाद की गई कार्रवाई के लिए कोई ऑटोकॉम्ड है?
:help CursorHold
When the user doesn't press a key for the time
specified with 'updatetime'. Not re-triggered
until the user has pressed a key (i.e. doesn't
fire every 'updatetime' ms if you leave Vim to
make some coffee. :) See |CursorHold-example|
for previewing tags.
This event is only triggered in Normal mode.
It is not triggered when waiting for a command
argument to be typed, or a movement after an
operator.
While recording the CursorHold event is not
triggered. |q|
Note: Interactive commands cannot be used for
this event. There is no hit-enter prompt,
the screen is updated directly (when needed).
Note: In the future there will probably be
another option to set the time.
Hint: to force an update of the status lines
use: >
:let &ro = &ro
{only on Amiga, Unix, Win32, MSDOS and all GUI
versions}
*CursorHoldI*
तो, आप एक शुरुआत के लिए
let g:idle_counter = 0
function! Idle()
echo "I am idle!!!! (" . g:idle_counter . ")"
let g:idle_counter = g:idle_counter + 1
endfunction
autocmd CursorHold * call Idle()
कोशिश कर सकते हैं।