Permalink
Browse files

Highlight the current line, only for the buffer with focus

Reason for Change
=================
* Sometimes, it's hard to find the cursor :/

Changes
=======
* Set the `cursorline` in a smart way.

Thanks!
-------
* @thorncp
* @gabebw

Original: gabebw/dotfiles@ed3759c#commitcomment-21957151
  • Loading branch information...
1 parent e06a336 commit 748ebc90dfe5af6ebca28dc71a3d2964d23d050c @adarsh committed Apr 29, 2017
Showing with 7 additions and 0 deletions.
  1. +7 −0 vimrc
View
7 vimrc
@@ -178,3 +178,10 @@ let g:highlightedyank_highlight_duration = 5000
" Treat .etl files like .rb
au BufRead,BufNewFile *.etl setfiletype ruby
+
+" Highlight the current line, only for the buffer with focus
+augroup CursorLine
+ autocmd!
+ autocmd VimEnter,WinEnter,BufWinEnter * setlocal cursorline
+ autocmd WinLeave * setlocal nocursorline
+augroup END

2 comments on commit 748ebc9

❤️

💚

Please sign in to comment.