Is there some plugin for bash that will modify tab complete when I'm trying to open a file with vim? For example, if I have a directory with the following files:
(where foo/ and bar/ are directories, and foo is a binary file)
and I do this:
vim f
and then hit tab, is there a way for the autocomplete to ignore the foo/ and foo binary files, and automatically fill it in with "foo.c", since that's the only text file that starts with f?
Yes! It's not really a plugin per se, but you can edit bash's autocomplete configuration file to match parameters for specific applications. On Debian-based systems, you'll find this configuration file at /etc/bash_completion
.
In fact, there's a handy guide to modifying /etc/bash_completion
over at Debian Administration. I'm sure you could modify filename completion to only accept non-binary files.
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