mirror of https://github.com/bjeanes/dotfiles.git
Moved functions into own file
parent
8767ed612a
commit
8dbb360357
|
@ -34,37 +34,3 @@ alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'
|
|||
|
||||
alias pubkey="cat $HOME/.ssh/*.pub"
|
||||
alias colorslist="set | egrep 'COLOR_\w*'" # lists all the colors
|
||||
|
||||
function f() { find * -name $1; }
|
||||
function p() {
|
||||
cd $* && m
|
||||
}
|
||||
function m() {
|
||||
if [ -n "$*" ]; then
|
||||
files=$*
|
||||
else
|
||||
files=.
|
||||
fi
|
||||
mate -l1 $files 2>/dev/null
|
||||
}
|
||||
|
||||
function extract() {
|
||||
if [ -f $1 ] ; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xvjf $1 ;;
|
||||
*.tar.gz) tar xvzf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) unrar x $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xvf $1 ;;
|
||||
*.tbz2) tar xvjf $1 ;;
|
||||
*.tgz) tar xvzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*) echo "'$1' cannot be extracted via >extract<" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
||||
}
|
|
@ -4,6 +4,7 @@ CDPATH=".:${HOME}"
|
|||
source $DOT_FILES/$CURRENT_SHELL/config.*sh
|
||||
source $DOT_FILES/shell/exports.sh
|
||||
source $DOT_FILES/shell/aliases.sh
|
||||
source $DOT_FILES/shell/functions.sh
|
||||
source $DOT_FILES/shell/save-directory.sh
|
||||
source $DOT_FILES/shell/prompt.sh
|
||||
source $DOT_FILES/shell/git.sh
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
function f() { find * -name $1; }
|
||||
function p() {
|
||||
cd $* && m
|
||||
}
|
||||
function m() {
|
||||
if [ -n "$*" ]; then
|
||||
files=$*
|
||||
else
|
||||
files=.
|
||||
fi
|
||||
mate -l1 $files 2>/dev/null
|
||||
}
|
||||
|
||||
function extract() {
|
||||
if [ -f $1 ] ; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xvjf $1 ;;
|
||||
*.tar.gz) tar xvzf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) unrar x $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xvf $1 ;;
|
||||
*.tbz2) tar xvjf $1 ;;
|
||||
*.tgz) tar xvzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*) echo "'$1' cannot be extracted via >extract<" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
||||
}
|
Loading…
Reference in New Issue