Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What autocmd event is triggered when we move cursor to window?

Tags:

vim

What event is triggered when we move between open windows (splits) using CTRL-W W?

                                                *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).

I used BufEnter, BufWinEnter, FocusGained, WinEnter, CmdwinEnter, TabEnter. But none of them are triggering the autocommand.

For now, I'm forced to alt-tab between windows to reliably trigger the autocommand.

like image 681
wiredcontrol Avatar asked Dec 06 '25 08:12

wiredcontrol


1 Answers

The correct event is WinEnter. If that doesn't work for you (with plugins enabled), check the 'eventignore' option.

like image 184
Ingo Karkat Avatar answered Dec 09 '25 05:12

Ingo Karkat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!