19

In bash, I can use tab-completion to move one directory up and descend down again another path. For example, suppose I'm in $HOME/folder1, and I want to cd to $HOME/folder2. $HOME only has the two child directories folder1 and folder2.

In bash, I could just type

cd ..[TAB]f[TAB]2

and would end up in $HOME/folder2. In my fresh zsh installation, pressing cd ..[TAB] produces a list of those child directories of $HOME/folder1 which have two . in their name.

Is there a simple way to get the behaviour I'm used to? Or is there something even easier to achieve what I want in zsh?

4
  • Yeah, (re)learn to hit / (slash) instead of TAB for a directory delimiter. You've already typed .. the / is right next to . on every keyboard I've seen. Commented Feb 7, 2014 at 18:23
  • 2
    Down voting a new user with an honest question isn't cool. No reason for that! I see that he tried explaining the best he could. Commented Feb 7, 2014 at 19:18
  • 9
    @RickyBeam You should take a look at non-english keyboards then ;) I'm using a German keyboard, and there the / is very inconveniently located at SHIFT+7. Commented Feb 7, 2014 at 19:32
  • I have a UK and Korean(?) keyboard, and they both use a standard QWERTY layout. DEC and SUN keyboards can be a little weird, but I don't have them at hand. I'd reprogram my keyboard if I had to hit shift-7 to get a slash. Commented Feb 7, 2014 at 19:53

1 Answer 1

24

Add this to your .zshrc and ..[TAB] will complete to ../ as per bash.

zstyle ':completion:*' special-dirs true

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.