我想Insert
在一段时间(15 秒)后自动让 Vim 离开模式。这是我的.vimrc
:
" set 'updatetime' to 15 seconds when in insert mode
au InsertEnter * let updaterestore = &updatetime | set updatetime=15000
au InsertLeave * let &updatetime = updaterestore
" automatically leave insert mode after 'updatetime' milliseconds of inaction
au CursorHoldI * stopinsert
我在 MacVim 中使用这个片段,但它不起作用。当我进入Insert
模式并且我什么都不做时,Vim 会在 15 秒后退出插入模式。但是,如果我按Enter
or ,或者如果我使用/Backspace
进入模式,那么 Vim 会立即离开模式,并且在那时,即使我使用
Vim 进入模式也会立即返回模式。Insert
o
O
Insert
Insert
i
Normal
我在 Mac OS X 10.8.5 上使用 Homebrew 安装了 MacVim
任何想法为什么这不起作用?
编辑:这是我的带有所有标志的 MacVim 版本:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 29 2013 02:17:27)
MacOS X (unix) version
Included patches: 1-22
Compiled by Homebrew
Huge version with MacVim GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_binary
+arabic +find_in_path -mouse_sysmouse +tag_old_static
+autocmd +float +mouse_urxvt -tag_any_white
+balloon_eval +folding +mouse_xterm +tcl
+browse -footer +multi_byte +terminfo
++builtin_terms +fork() +multi_lang +termresponse
+byte_offset +fullscreen -mzscheme +textobjects
+cindent -gettext +netbeans_intg +title
+clientserver -hangul_input +odbeditor +toolbar
+clipboard +iconv +path_extra +transparency
+cmdline_compl +insert_expand +perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con_gui -lua +rightleft +windows
+diff +menu +ruby +writebackup
+digraphs +mksession +scrollbind -X11
+dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent +xim
+emacs_tags +mouseshape -sniff -xsmp
+eval +mouse_dec +startuptime -xterm_clipboard
+ex_extra -mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop -xpm
+farsi +mouse_netterm +syntax
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X_UNIX -no-cpp-precomp -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -I/System/Library/Frameworks/Tcl.framework/Headers -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_DARWIN_C_SOURCE=1
Linking: cc -L. -L. -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lncurses -liconv -framework Cocoa -fstack-protector -L/usr/local/lib -L/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -framework Python -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby