Search code examples
vimvim-plugin

View vim variables with names matching pattern (i.e. show variables with name containing "airline")


I can see a plugin's configurable variables by running

:let

But, as more are installed, this gets tedious. And they aren't alphabetically sorted.

I can of course go through the plugin's documentation.

In vim, is there a way to see all variables with names matching a pattern? Like, what if I want to see all variables containing airline? Not just ones starting with airline, but also ones with prefixes like b:airline_whitespace_check?

Regardless of if there's way built into vim to do this, is there a way to pipe the contents of :let through grep through a subshell? So something like this could be done:

<magic that echos :let to subshell> | grep airline | sort

Solution

  • You could simply use command-line completion:

    :let qf<C-d>
    qf_mapping_ack_style            qf_mapping_filegroup_next
    qf_mapping_filegroup_previous   qf_statusline
    

    Note that :let won't show you all plugin variables. It only shows those that are defined in the current context.


    The "new" :help :filter command sadly doesn't work on :let so it's useless here.


    Another way:

    :redir @a
    :let
    :redir END
    :vnew
    @ap
    :v/qf/d