Move up() to its own function file
This commit is contained in:
parent
6184eba778
commit
0c08add311
2 changed files with 16 additions and 21 deletions
15
zsh/func/up
Normal file
15
zsh/func/up
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/zsh
|
||||
# Go up $1 directories, where $1 is an integer (saves me from having to type ../
|
||||
# ad nauseum)
|
||||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
cd ..
|
||||
else
|
||||
local updir=''
|
||||
for (( i=0; $i < $1; i++ ))
|
||||
do
|
||||
updir="../$updir"
|
||||
done
|
||||
cd $updir
|
||||
fi
|
22
zshrc
22
zshrc
|
@ -149,27 +149,6 @@ function configure_completion #{{{
|
|||
} #}}}
|
||||
|
||||
|
||||
###
|
||||
# FUNCTIONS
|
||||
###
|
||||
|
||||
# Generate a password
|
||||
|
||||
# Go up $1 directories, where $1 is an integer (saves me from having to type ../
|
||||
# ad nauseum)
|
||||
function up {
|
||||
if [[ -z $1 ]]; then
|
||||
cd ..
|
||||
else
|
||||
local updir=''
|
||||
for (( i=0; $i < $1; i++ ))
|
||||
do
|
||||
updir="../$updir"
|
||||
done
|
||||
cd $updir
|
||||
fi
|
||||
}
|
||||
|
||||
configure_general
|
||||
configure_zle
|
||||
configure_fpath
|
||||
|
@ -179,6 +158,7 @@ configure_history
|
|||
configure_completion
|
||||
configure_prompt
|
||||
|
||||
|
||||
if [ -e $HOME/.zshrc.$SYS ]; then
|
||||
print_info_noisy 3 "Sourcing ${SYS}-specific Z Shell settings"
|
||||
source $HOME/.zshrc.$SYS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue