Tips: smarter cursorline

This commit is contained in:
Marco Hinz 2016-01-18 12:40:05 +01:00
parent bc67c92407
commit c27bdfbc29
2 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file.
- Commands: [:redir](README.md#redir) - Commands: [:redir](README.md#redir)
- Tips: [Saner command-line history](README.md#saner-command-line-history) - 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: [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: [Editing remote files](README.md#editing-remote-files)
- Usage: [Restore cursor position when opening file](README.md#restore-cursor-position-when-opening-file) - Usage: [Restore cursor position when opening file](README.md#restore-cursor-position-when-opening-file)
- Usage: [MatchIt](README.md#matchit) - Usage: [MatchIt](README.md#matchit)

View File

@ -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) - [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) - [Don't lose selection when shifting sidewards](#dont-lose-selection-when-shifting-sidewards)
- [Reload a file on saving](#reload-a-file-on-saving) - [Reload a file on saving](#reload-a-file-on-saving)
- [Smarter cursorline](#smarter-cursorline)
#### [Commands](#commands-1) #### [Commands](#commands-1)
@ -1204,6 +1205,18 @@ autocmd BufWritePost $MYVIMRC source $MYVIMRC
autocmd BufWritePost ~/.Xdefaults call system('xrdb ~/.Xdefaults') 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 ## Commands
Useful commands that are good to know. Useful commands that are good to know.