From f34ee3da80e864ff545169bc2ced856bf5822260 Mon Sep 17 00:00:00 2001 From: Kyle <50718101+kylesower@users.noreply.github.com> Date: Sun, 28 Jun 2026 12:20:56 -0500 Subject: feat(api): nvim_set_option_value(operation=...) #39849 Problem: `nvim_set_option_value` cannot "update" options similar to `:set opt=`, `:set opt+=`, etc. The Lua impls of "vim.opt" / "vim.o" have incomplete, bespoke reimplementations of those operations. ref #38420 Solution: - Add `operation` param to `nvim_set_option_value`, which may be "set", "append", "prepend", or "remove". - Use this feature to implement `vim.opt` / `vim.o`. --- runtime/doc/lua.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runtime/doc/lua.txt') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 2a684af19f..cc2b8ffd16 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -961,6 +961,12 @@ Vim options can be accessed through |vim.o|, which behaves like Vimscript To set a string value: Vimscript: `set wildignore=*.o,*.a,__pycache__` Lua: `vim.o.wildignore = '*.o,*.a,__pycache__'` + Lua (alt): `vim.o.wildignore = { '*.o', '*.a', '__pycache__' }` + + To set a key:value type option: + Vimscript: `set listchars=eol:~,space:-` + Lua: `vim.o.listchars = 'eol:~,space:-'` + Lua (alt): `vim.o.listchars = { eol = '~', space = '-' }` Similarly, there is |vim.bo| and |vim.wo| for setting buffer-scoped and window-scoped options. Note that this must NOT be confused with -- cgit