Hi all, Currently Vim options can be accessed from a Vim script by prefixing the option name with a '&':
let &shiftwidth = 2 let oldval = &shiftwidth The Python Vim interface supports a dictionary for accessing the Vim options https://vimhelp.org/if_pyth.txt.html#python-options The Lua Vim interface in Neovim support this: https://github.com/neovim/neovim/blob/master/runtime/doc/lua.txt#L1022 But this is currently not supported by Vim script. What do you think about adding support for a v:vim.opt dictionary to read/modify Vim options: let v:vim.opt.shiftwidth = 2 let oldval = v:vim.opt.shiftwidth echo has_key(v:vim.opt, 'newopt') echo keys(v:vim.opt) echo items(v:vim.opt) The changes to support this are available at: https://github.com/yegappan/vim/commit/52beff56044e93c7bb982243ff593b461cd649c2 Regards, Yegappan -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAAW7x7k_%2BupnGNsrD3T_x7am98jKgacA2rE6MNjNUQayCuDw-w%40mail.gmail.com.
