diff --git a/CHANGELOG.md b/CHANGELOG.md index 7814044..f4cbf33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) - Neovim: [Terminal emulator](content/neovim.md#terminal-emulator) - Neovim: [Configuration](content/neovim.md#configuration) +- Neovim: [Change cursor style dependent on mode](content/neovim.md#change-cursor-style-dependent-on-mode) ### Changed diff --git a/README.md b/README.md index ebba83c..3864b6d 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Twitter](https://twitter.com/_mhinz_). Thanks! - [Quickly edit your macros](#quickly-edit-your-macros) - [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) -- [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) - [Reload a file on saving](#reload-a-file-on-saving) - [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', '') ``` -#### 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 underline cursor in replace mode. Also when using tmux in the middle. diff --git a/content/neovim.md b/content/neovim.md index 8e3aaf1..116ff25 100644 --- a/content/neovim.md +++ b/content/neovim.md @@ -3,6 +3,7 @@ - [Help](#help) - [Configuration](#configuration) - [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 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`