2017-04-12 76 views
1

當我們使用CTRL-W W在打開的窗口(拆分)之間移動時,會觸發什麼事件?當我們將光標移動到窗口時會觸發什麼autocmd事件?

           *CTRL-W_W* 
CTRL-W W  Without count: move cursor to window above/left of current 
      one. If there is no window above or left, go to bottom-right 
      window. With count: go to Nth window (windows are numbered 
      from top-left to bottom-right). 

我用BufEnterBufWinEnterFocusGainedWinEnterCmdwinEnterTabEnter。但是他們都沒有觸發自動命令。

現在,我不得不通過窗口之間的alt-tab來可靠地觸發autocommand

+0

我無法重現您的狀態。試試'vim -u NONE + vsp +「au WinEnter * echo'YO'」'然後按下Ctrl-W W;你應該在屏幕底部看到'YO'。如果你不這樣做,你會有一個奇怪的Vim。如果你這樣做,嘗試沒有'-u NONE'。如果你現在不這樣做,插件(或vimrc設置)會干擾。 – Amadan

+1

Alt-Tab不允許您在「打開窗口(分割)」之間切換。只在GUI窗口和Vim實例之間。看起來這裏有一個相當大的理解根源問題。 – romainl

+0

請添加一個你如何使用這些自動命令的例子 – yolenoyer

回答

1

正確的事件是WinEnter。如果這不起作用(啓用插件),請檢查'eventignore'選項。

+0

我查過了。但'eventignore'設置爲空。 – wiredcontrol

相關問題