I'm trying to conditionally load files in vim/neovim with Vimscript, except where the filename is prefixed with an underscore. It's not working 100% yet, instead all the files are still loading:
for filename in split(globpath('~/.config/nvim/plugins', '*.vim'), '\n')
if filename !~ "^_"
exe 'source' filename
endif
endfor
Sort of works with file !~ "_"
, but that matches with the underscore anywhere in the string. I need ignore only filenames that start with _.