Skip to content
/ cdpp Public

A shell function supporting one keystroke to change directory to parent path

Notifications You must be signed in to change notification settings

rydesun/cdpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

cdpp

cdpp, a shell function supporting one keystroke to change directory to parent path.

cdpp is light and portable. It has only one dependency for querying terminfo database: tput. This means no demand for sed, awk, and so on.

Ordinary Mode

demonstration

Compact Mode

demonstration

enable method:

sed -i 's/echo ${PWD/echo -n ${PWD/' cdpp.sh

Install

bash user

cat cdpp.sh >> ~/.bashrc
source ~/.bashrc

zsh user

sed -e '/^\s\+read/s/-n/-k/' -e 's/${!idpath\[@\]}/${(k)idpath}/' \
-e 's/\(\${#idpath\[@\]}\) - 1/\1/' cdpp.sh >> ~/.zshrc
source ~/.zshrc

FAQ

Q: How to quit cdpp immediately and keep current working directory?

A: Press Ctrl+C.

Q: How to combine cdpp with other command temporarily and Don't change current working directory?

A: Place cdpp in subshell. For example: (cdpp; touch something)

Other Resource

If you want to go back to a parent directory by typing directory name, I recommend bd.

If you want to quickly access to files and directories, I recommend fasd or autojump.

About

A shell function supporting one keystroke to change directory to parent path

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages