bash-completion
bash-completion copied to clipboard
Adds `cd-shortcuts` a Bash completion function to improve the "cd"
_cd_shortcuts() is a Bash completion function to improve "cd" command adding two new shortcuts:
up : ^{number}
To go {number} directories up from current path, for example:
cd /usr/src/linux-headers-5.0.0-20-generic/arch/x86/kernel
cd ^4<Tab> → cd ../../../../
at : @<name>
To go to first {name} directory from the right to the left starting to current path.
cd /usr/src/linux-headers-5.0.0-20-generic/arch/x86/kernel
cd @src<Tab> → cd /usr/src
If ^ or @ are not detected it calls the original completion for "cd".
I've checked travis-ci logs and looks like that some error happened during tests on Debian 10 but not related with my PR.