vim-bootstrap icon indicating copy to clipboard operation
vim-bootstrap copied to clipboard

Gaurd guioptions= with a nvim init.vim check

Open ross opened this issue 3 months ago • 0 comments

It appears newer versions of NeoVim have modified guioptions to be immutable causing an error when it's set. This PR adds a guard to the template to omit that line when the target is nvim

Error messages

Clean fedora linux 42 box.

ross@sailfish:~/.config/nvim $ nvim --version
NVIM v0.11.4
Build type: RelWithDebInfo
LuaJIT 2.1.1748459687
Run "nvim -V1 -v" for more info

At startup in the console or when using the VSCode neovim extension I get the following error:

Console

Error detected while processing /home/ross/.config/nvim/init.vim:
line  215:
E519: Option not supported: guioptions=egmrti
Press ENTER or type command to continue

VSCode

2025-10-18 08:56:32.111 [info] MessagesManager: 'Error detected while processing /home/ross/.config/nvim/init.vim:line  215:\n' +
  'E519: Option not supported: guioptions=egmrti\n'

Offending line

https://github.com/editor-bootstrap/vim-bootstrap/blob/7d79690d9b8bd4ac2d8ce9c9bb23266f381a74c0/generate/vim_template/vimrc#L168

Research

There's a couple related issues in neovim's repo, https://github.com/neovim/neovim/issues/32396 seems to be the primary and a comment there, https://github.com/neovim/neovim/issues/32396#issuecomment-2652291781, links to a PR https://github.com/neovim/neovim/pull/28400#issuecomment-2067661964 which changed guioptions from hidden to immutable meaning that it can be read/seen, but not set.

TL;DR:

Seems guioptions isn't supported by neovim, but is still present. Previously it could be set, but was ignored, now it can not.

Options

  • Guard the line during template generation {{if ne .Editor "nvim"}}set guioptions=egmrti{{end}} (this PR)
  • Guard the line with if !has('nvim') for runtime detection
  • Something else/I've got the problem wrong.

ross avatar Oct 18 '25 16:10 ross