Function to go up n directories
This commit is contained in:
parent
c1ccacc944
commit
e0398fd5c8
1 changed files with 10 additions and 0 deletions
10
zshrc
10
zshrc
|
@ -127,3 +127,13 @@ autoload mkmdir
|
|||
autoload pw
|
||||
autoload mkcmod
|
||||
|
||||
# Go up n directories (saves me from having to type ../ ad # nauseum)
|
||||
function up {
|
||||
if [[ -z $1 ]]; then
|
||||
pushd ..
|
||||
else
|
||||
updirs=()
|
||||
for (( i=0; $i < $1; i++ )); do updirs+='..' done
|
||||
pushd ${(j./.)updirs}
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue