1
votes

I have install neovim and linked the .vimrc to the .config/nvim/init file. neovim splits out the following character [2 q% on the terminal screen upon closing. The weird characters even appears when I press : inside neovim.

enter image description here

1

1 Answers

5
votes

In Nvim 0.1.7, that happens because your terminal (1) doesn't support cursor shape control sequences, and (2) doesn't properly ignore unknown sequences. To avoid it, put this in your ~/.config/nvim/init.vim:

let $NVIM_TUI_ENABLE_CURSOR_SHAPE=0

That's also mentioned in man nvim.


In Nvim 0.2, cursor styling is controlled by the guicursor option. If you see "weird characters" like [2 q%, it means your terminal (probably) doesn't support this feature, but guicursor was enabled somewhere in your configuration. Disable guicursor by setting it empty:

:set guicursor=

(Nvim disables guicursor by default if it's not sure about your terminal. But if you set guicursor anyway, Nvim will send the cursor shape control sequences to the terminal.)