I am trying to populate the vim arglist with all filenames in a directory that do not include "matcher". I can populate it with filenames that DO include "matcher" using
args *matcher*
Is there a simple way to negate the glob to get all the files that don't match?
The only way I know is as follows:
:args * | silent! argdelete *matcher*
The silent!
part is needed to omit No match
error.
Update. One can also create a handy command to type less keys:
:command! -nargs=* Args args * | silent! argdelete <args>
And use it like this:
:Args *matcher*
xaizek's command is short and clever; unfortunately, it only deals with argument files from the current directory. I've expanded on that to work with any directory, and bundle this with other helpful commands for argument handling in my ArgsAndMore plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With