Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a folder structure that's in subversion.

There are a whole pile of top level directories that have only 1 sub folder. (eg src/com/example). Normally when I want to cd into the example folder I can go cd src/<tab><tab> since bash will fill in the folder names, since there is only one per folder it goes all the way.

However since that directory structure is now in svn, there's a .svn directory in each one, and this means I can't cd as quickly.

If I try cd src/<tab> it suggests .svn and com, as opposed to automatically filling in com.

Is there some way to tell bash never to suggest cd'ing into a .svn folder, so that if I tab complete it won't include .svn?

share|improve this question

1 Answer 1

I can give you two options. Either of which can be placed in your ~/.bash_profile.

  • Bash uses a variable $FIGNORE which defines any suffixes that auto-completion will ignore. There seems to be a catch though, in that it prefixes any value with *.. So a setting of:

    export FIGNORE=.svn
    

    Will only ignore directories that have something before the period. And:

    export FIGNORE=svn
    

    Will ignore .svn directories and anything else that ends in .svn.

    Caveat emptor.

  • You can prevent all hidden files and directories from being included in auto-completion:

    bind 'set match-hidden-files off'
    

    But you might not find this suitable.

share|improve this answer
    
interesting, but quite tricky –  AlberT Oct 8 '09 at 10:16

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.