I use some statusline plugin, which source theme files from <the-autoload-directory>/lightline/colorscheme/*.vim.

Many color plugins also provide themes for that statusline. Switching the theme requires just one argument, the theme name, which is same as its file name. So I would like to get the list of available themes, i.e. list of files at that path. Putting the list at current cursor position would be good enough.

Closest command is :runtime lightline/or/smth/*.vim which would execute files rather than list them.

For the plain colorschemes the list is generated on :colo <tab> , though I don't know how it does its job..

2 Answers 2


:h glob()

And for your case it might be:

:echo glob("~/.vim/**/lightline/**/*.vim")
  • thanx, it did the job Mar 25, 2022 at 11:52

I'd use globpath() instead of glob() as you seems to be interested in all autoload directories.

echo globpath(&rtp, 'autoload/**/lightline/**/*.vim')

Internally, Vim also uses the 'runtimepath' to search for files with all these commands.

Note: if you want to do something programmatically with it, set {list} parameter to 1 in order to obtain a List

echo globpath(&rtp, 'autoload/**/lightline/**/*.vim', 0, 1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.