Is it possible to get a list of declared variables with a VimL (aka VimScript) expression? I’d like to get the same set of values that will be presented for a command using -complete=expression. The goal is to augment that list for use in a user-defined command completion function.
Is it possible to get a list of declared variables with a VimL (aka
Share
You can use
g:as a dictionary that holds all global variables, so:will give you all the names. The same applies to the other scopes:
b:,s:,w:, etc. See:help internal-variablesfor the complete list.