Neovim: change cursor style dependent on mode

This commit is contained in:
Michael Reed 2016-02-04 22:53:48 -05:00 committed by Marco Hinz
parent 09c8f4fa9d
commit cb2b9fa73b
3 changed files with 19 additions and 2 deletions

View File

@ -47,6 +47,7 @@ All notable changes to this project will be documented in this file.
- Misc: [Map CapsLock to Control](README.md#map-capslock-to-control) - Misc: [Map CapsLock to Control](README.md#map-capslock-to-control)
- Neovim: [Terminal emulator](content/neovim.md#terminal-emulator) - Neovim: [Terminal emulator](content/neovim.md#terminal-emulator)
- Neovim: [Configuration](content/neovim.md#configuration) - Neovim: [Configuration](content/neovim.md#configuration)
- Neovim: [Change cursor style dependent on mode](content/neovim.md#change-cursor-style-dependent-on-mode)
### Changed ### Changed

View File

@ -67,7 +67,7 @@ Twitter](https://twitter.com/_mhinz_). Thanks!
- [Quickly edit your macros](#quickly-edit-your-macros) - [Quickly edit your macros](#quickly-edit-your-macros)
- [Quickly jump to header or source file](#quickly-jump-to-header-or-source-file) - [Quickly jump to header or source file](#quickly-jump-to-header-or-source-file)
- [Quickly change font size in GUI](#quickly-change-font-size-in-gui) - [Quickly change font size in GUI](#quickly-change-font-size-in-gui)
- [Change cursor style in insert mode](#change-cursor-style-in-insert-mode) - [Change cursor style dependent on mode](#change-cursor-style-dependent-on-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) - [Smarter cursorline](#smarter-cursorline)
@ -1762,7 +1762,7 @@ command! Bigger :let &guifont = substitute(&guifont, '\d\+$', '\=submatch(0)+1'
command! Smaller :let &guifont = substitute(&guifont, '\d\+$', '\=submatch(0)-1', '') command! Smaller :let &guifont = substitute(&guifont, '\d\+$', '\=submatch(0)-1', '')
``` ```
#### Change cursor style in insert mode #### Change cursor style dependent on mode
I like to use a block cursor in normal mode, i-beam cursor in insert mode, and I like to use a block cursor in normal mode, i-beam cursor in insert mode, and
underline cursor in replace mode. Also when using tmux in the middle. underline cursor in replace mode. Also when using tmux in the middle.

View File

@ -3,6 +3,7 @@
- [Help](#help) - [Help](#help)
- [Configuration](#configuration) - [Configuration](#configuration)
- [Terminal emulator](#terminal-emulator) - [Terminal emulator](#terminal-emulator)
- [Change cursor style dependent on mode](#change-cursor-style-dependent-on-mode)
--- ---
@ -82,3 +83,18 @@ Related help:
:h :terminal :h :terminal
:h nvim-terminal-emulator :h nvim-terminal-emulator
#### Change cursor style dependent on mode
The method mentioned in the [Vim
section](../README.md#change-cursor-style-dependent-on-mode) doesn't work in
Neovim. Instead, define the environment variable `NVIM_TUI_ENABLE_CURSOR_SHAPE`
either in your shell config or in your vimrc:
```vim
if has('nvim')
let $NVIM_TUI_ENABLE_CURSOR_SHAPE = 1
endif
```
Related help: `$ man 1 nvim`