In my vimrc file i have this option set cursorline
. I want to hide this line if that window is not in focus . Is there an option in vim to do that?
See this
Essentially, it's just the following autocmds:
augroup CursorLine
au!
au VimEnter * setlocal cursorline
au WinEnter * setlocal cursorline
au BufWinEnter * setlocal cursorline
au WinLeave * setlocal nocursorline
augroup END
But occasionally, you may want to define exceptions (i.e. permanently on or off) for certain windows. That's where my CursorLineCurrentWindow plugin may be helpful.
It sounds like you want the cursorline on when entering a vim buffer and off when leaving it. These commands in the vimrc file will achieve this:
autocmd BufEnter * set cursorline
autocmd BufLeave * set nocursorline
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With