问题
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:
fooandfoo-barare in the same directory.- Deleting/moving
fooisn't an option (I've hidden some details).
Is there a way to ignore a specific path entry?
回答1:
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.
回答2:
Give this a try:
FIGNORE=foo-bar
来源:https://stackoverflow.com/questions/2225976/ignore-a-path-entry-with-bash-tab-completion