Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Using the git status command, I had:

modified:   conf/test.conf

Is it possible to configure bash in that way so when I type git diff *test.conf and press TAB for auto-complete, it would expand it to full path. i.e: conf/test.conf?

share|improve this question

1 Answer 1

I'm not a nor a expert, but this works for me:

git diff *$(file="$(git status -s)"; echo ${file:2})

I haven't tested yet with multiple pending files or multiple directories, but you can change and use these to work mostly like a shortcut to your file/directory.

For using the TAB key in the terminal, I don't think there's an easy way to change the terminal keys behavior based on the running command (Someone correct me if I'm wrong).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.