diff --git a/CHANGELOG.md b/CHANGELOG.md index ab1e709..f5873e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. - Commands: [:redir](README.md#redir) - Tips: [Saner command-line history](README.md#saner-command-line-history) - Tips: [Reload a file on saving](README.md#reload-a-file-on-saving) +- Tips: [Smarter cursorline](README.md#smarter-cursorline) - Usage: [Editing remote files](README.md#editing-remote-files) - Usage: [Restore cursor position when opening file](README.md#restore-cursor-position-when-opening-file) - Usage: [MatchIt](README.md#matchit) diff --git a/README.md b/README.md index 373e6ec..7967f97 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ added every day. Things about to be added can be found here: - [Change cursor style in insert mode](#change-cursor-style-in-insert-mode) - [Don't lose selection when shifting sidewards](#dont-lose-selection-when-shifting-sidewards) - [Reload a file on saving](#reload-a-file-on-saving) +- [Smarter cursorline](#smarter-cursorline) #### [Commands](#commands-1) @@ -1204,6 +1205,18 @@ autocmd BufWritePost $MYVIMRC source $MYVIMRC autocmd BufWritePost ~/.Xdefaults call system('xrdb ~/.Xdefaults') ``` +#### Smarter cursorline + +I love the cursorline, but I only want to use it in the current window and not +when being in insert mode: + +```viml +autocmd WinEnter * set cursorline +autocmd WinLeave * set nocursorline +autocmd InsertEnter * set nocursorline +autocmd InsertLeave * set cursorline +``` + ## Commands Useful commands that are good to know.