Search directories with peco when pressing ctrl+f
NOTE: By default the plugin will only query for directories under the curent users home directory.
ie for non root users this would be $HOME
and for root /
Based on zsh-peco-history.
- press ctrl + f when in zsh shell
- start typing to filter out your directory
- press enter/return to pick a directory to change to
-
clone this repo to your machine. This guide uses
~/.zsh/zsh-peco-cd
git clone https://github.com/kareem-abdul/zsh-peco-cd.git ~/.zsh/zsh-peco-cd
-
Add the following to your
.zshrc
:source ~/.zsh/zsh-peco-cd/zsh-peco-cd.zsh
-
Start a new terminal session
- Clone this repo into
$ZSH_CUSTOM/plugins
(by default this is ~/.oh-my-zsh/custom/plugins)git clone https://github.com/kareem-abdul/zsh-peco-cd.git ${ZSH_CUSTOM:~/.oh-my-zsh/custom}/plugins/zsh-peco-cd
- Add the plugin to the list of plugins in your
.zshrc
for Oh My Zsh to load:plugin=(zsh-peco-cd)
- Start a new terminal session
These are the directories in regex which this plugin ignores.
This by default is set to node_modules|\.git|\.cache|\.config
, ie any directory which has the above
names will be ignored and will not be listed in the peco menu
By default the plugin will only query for directories under the curent users home directory.
ie for non root users this would be $HOME
and for root /
You can change this behaviour by specifying a directory in the ZSH_PECO_CD_ROOT
ie ZSH_PECO_CD_ROOT="$HOME/workspace"
will only search the directories and subdirecotries under
$HOME/workspace