Yegappan wrote:
> 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 I do not see the advantage. It's extra code, more choices for a script writer, thus there needs to be a good justification. -- BEDEVERE: How do you know so much about swallows? ARTHUR: Well you have to know these things when you're a king, you know. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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/20220124114304.846D81C0243%40moolenaar.net.
