I have two commands, foo
and foo-bar
, where foo
is a symlink to foo-bar
. I want to be able to type f
+TAB (pretend these are the only two commands on the path that begin with f
) and have one of them be completed (meaning the full name and the space after).
What ends up happening though is that it completes to just foo
(no space) because of foo-bar
. It's obviously not much work to then just hit the space bar, but this interrupts my flow.
Some additional details:
foo
and foo-bar
are in the same directory.foo
isn't an option (I've hidden some details).Is there a way to ignore a specific path entry?
It can be enabled for all future bash sessions by putting set completion-ignore-case on into the users's ~/. inputrc file, or the system /etc/inputrc , to enable it for all users.
Bourne shell and csh do not, but ksh, bash, tcsh, and zsh all have tab completion to varying degrees. The basic principle in all of these shells is the same; you type the start of the word, hit the <TAB> key twice, and the list of possible commands or files is displayed.
You use FIGNORE, although it has some strange properties.
FIGNORE requires a proper suffix. So to ignore foo-bar, any of these will work:
FIGNORE=bar
FIGNORE=-bar
FIGNORE=r
FIGNORE=oo-bar
The import thing is not to try FIGNORE=foo-bar
since it's not a proper suffix.
Give this a try:
FIGNORE=foo-bar
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