Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neovim: Change Cursor Type for Insert Mode

Tags:

neovim

I'm new to (Neo) Vim and I'm trying to find configurations that I like and learn from them.

Whenever I watch people code in vim/neovim, I notice that their cursor a thick box, same as when they're outside of Insert mode.

Basically, while in insert mode, my cursor is thin like this |, but I want to change it so that it's thick like it is when you're outside of insert mode.

I'm on the latest version of Neovim and I use Windows 10 if that's useful information.

like image 267
wasd Avatar asked Mar 21 '26 07:03

wasd


2 Answers

Yes, that is possible with guicursor option, but whether what option takes effect also depends on your terminal, for example, using Windows Termianl.

This is a working setting to make cursor shape block in insert mode:

set guicursor=n-v-c-i:block

which means to make cursor shape block in normal, visual, command, and insert mode. For more details, please use :h 'guicursor'.

like image 80
jdhao Avatar answered Mar 24 '26 16:03

jdhao


Lua workaround:

vim.opt.guicursor = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20"
like image 22
trash bin Avatar answered Mar 24 '26 15:03

trash bin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!