cd for sub directories
It defines a new command, called ccd that acts like cd but its argument is a pattern that can be expanded only by directories from the current directory.
-
Clone this repository somewhere on your machine. This guide will assume
~/.zsh/children-dirs
.git clone git://github.com/rools32/children-dirs ~/.zsh/children-dirs
-
Add the following to your
.zshrc
:autoload -Uz compinit && compinit source ~/.zsh/children-dirs/children-dirs.zsh
-
Start a new terminal session.
Let's take the following directory tree
.
├── bar1
├── bar2
└── foo
├── bar
└── foobar
Type ccd bar<TAB>
and get
Subdirectories:
bar1 bar2 foo/bar foo/foobar
-
Remove the code referencing this plugin from
~/.zshrc
. -
Remove the git repository from your hard drive
rm -rf ~/.zsh/children-dirs.zsh # Or wherever you installed