Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have got used to using tab-autocompleting inside braces without expanding in zsh. This was possible, while I used zsh with a basic grml-config. Since I migrated to oh-my-zsh, I can't reproduce this behaviour.

Example:

$ touch dir/{some_file,other_f<TAB>}

The behaviour I want:

$ touch dir/{some_file,other_file}

The behaviour I get:

$ touch dir/some_file dir/other_f

Instead of autocompleting, a tab expands the braces, defeating the purpose of the brace expansion, whenever I tab for any of the filenames.

I have searched for an answer in the manpages and the zsh-sites for anything relevant, but I couldn't find anything satisfying. Since I am still fresh to zsh, I am not sure, what to look for exactly, though.

I would appreciate any pointers on where to find any explanations relevant to this question. Thank you in advance for any helpful input!

share|improve this question
    
That's not the default zsh behavior. It's presumably something that oh-my-zsh does. I don't know what option would do this. –  Gilles Sep 23 '12 at 2:03
    
Are you sure it's not because the braces are closed, when they are still open I get the behavior you want. –  Thor Sep 23 '12 at 11:10
    
@Thor This answers my problem! Thank you! –  user23746 Sep 23 '12 at 12:28
add comment

1 Answer

up vote 2 down vote accepted

As Thor pointed out in his comment, the autocompletion in braces only works, until you put the closing brace.

So:

  • touch dir/{some_file,other_f<TAB>(without the closing brace!) autocompletes the filename, so you get touch dir/{some_file,other_file

  • touch dir/{some_file,other_f<TAB>}(with the closing brace!) expands the braces first, so you get touch dir/some_file dir/other_f

share|improve this answer
add comment

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.