0

Currently I am using a default nvim colorscheme gruvbox https://github.com/morhetz/gruvbox of which there are light and dark modes. In nvim, to set it to light mode you must input the command :set background=light and vice versa for dark. However, if I am in terminal mode in NVIM and I create a nested instance of NVIM, the option background is not persisted in newly created NVIM instance.

So my question: is there a way to persist options across sessions on the fly using the set command in vim? I tried looking at :setglobal and that did not work for me.

Additionally I know that I could use mkexrc to load my options back but I would like to update this background option on the fly without needing to restart my terminal.

1 Answer 1

1

In Neovim, options modified inline (e.g. within the editor using :set, or programmatically via Lua like vim.opt.number = true) do not persist across sessions by default.

You need to add your modifications in your configuration file (init.lua).

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.