sync/shells/zshrc

199 lines
6.0 KiB
Bash
Raw Normal View History

export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="af-magic"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
2014-08-29 09:46:43 -04:00
COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
2014-08-29 09:46:43 -04:00
HIST_STAMPS="dd/mm/yyyy"
setopt APPEND_HISTORY
HISTSIZE=12000
SAVEHIST=10000000
setopt HIST_EXPIRE_DUPS_FIRST
setopt EXTENDED_HISTORY
export PAGER=/usr/local/bin/vimpager
alias less=$PAGER
alias zless=$PAGER
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
plugins=(git)
source $ZSH/oh-my-zsh.sh
2014-08-22 14:14:45 -04:00
source /etc/zsh_command_not_found
export PATH="/home/stonewareslord/.autojump/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
2014-08-29 09:46:43 -04:00
export EDITOR='vim'
alias ls='ls --color=always -F'
alias ehistory='cat ~/.bash_eternal_history|grep $@'
alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"'
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias disphost='export DISPLAY=:0.0'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias logout='sudo pkill -u $USER'
alias fixsh='ssh-keygen -R'
alias tmux='tmux -2'
2014-08-29 09:46:43 -04:00
#alias less='less -r'
alias tree='tree -C'
alias grep="grep --color=auto"
alias skim="(head -5; tail -5) <"
alias cp="cp -v"
alias mv="mv -v"
alias la='ls -lah $LS_COLOR'
alias dt='date "+%F %T"'
alias awake='disphost; while true; do xdotool mousemove 0 0; sleep 60; done'
alias adk='2>/dev/null 1>&2 /home/stonewareslord/applications/adk/bin/studio.sh &'
alias resource='. ~/.zshrc'
alias install='sudo apt-get install'
alias search='apt-cache search'
alias remove='sudo apt-get remove'
alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade'
alias autoremove='sudo apt-get autoremove'
alias ..='k ..'
alias ...='k ../..'
alias ....='k ../../..'
alias .....='k ../../../..'
alias ......='k ../../../../..'
alias .......='k ../../../../../..'
alias ........='k ../../../../../../..'
alias .........='k ../../../../../../../..'
alias ..........='k ../../../../../../../../..'
alias ...........='k ../../../../../../../../../..'
alias ............='k ../../../../../../../../../../..'
alias .............='k ../../../../../../../../../../../..'
alias ..............='k ../../../../../../../../../../../../..'
alias ...............='k ../../../../../../../../../../../../../..'
alias ytdl="youtube-dl $@ -x --audio-format mp3 --audio-quality 0 -c -o '%(title)s.%(ext)s'"
alias tux="wemux"
alias rmgit="git remote rm origin;git remote rm https;git remote rm oOrigin;git remote rm oHttps"
2014-08-29 09:46:43 -04:00
alias rname="while true;do echo -n \"Rename: \";read A;echo -n \"To: \";read B;i3-msg 'rename workspace $A to $B';done"
alias g="git $@"
2014-08-29 09:46:43 -04:00
alias echip="curl ifconfig.me"
alias vpn="cd ~/.openvpn;sudo openvpn config.ovpn;cd -"
alias to="~/tmp/todo/todo.sh"
2014-08-19 13:20:34 -04:00
alias -s html="firefox"
alias -s log="less -MN"
alias -g nify=" > /dev/null 2>&1 &"
alias -g G='|& egrep -i'
2014-08-29 09:46:43 -04:00
function dnstest(){
echo "Testing ping:"
ping -c 3 8.8.8.8
echo "Testing IP curl:"
curl -k https://98.26.78.121/b/
echo "Testing DNS"
curl -k https://austenwares.com/b/
}
function cinitify(){
mkdir $2
cd $2
git init
git remote add origin git@austenwares.com:$1/$2.git
git remote add https https://austenwares.com/gitlab/$1/$2.git
#Offline mode
git remote add oOrigin git@10.0.1.200:$1/$2.git
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
git remote -v
git config http.sslVerify false
if [[ ! $3 == "-r" ]] ; then
echo -n "Pull from: "
read from
git pull $from
git checkout master
fi
}
function initify(){
git init
git remote add origin git@austenwares.com:$1/$2.git
git remote add https https://austenwares.com/gitlab/$1/$2.git
#Offline mode
git remote add oOrigin git@10.0.1.200:$1/$2.git
git remote add oHttps https://10.0.1.200/gitlab/$1/$2.git
git remote -v
git config http.sslVerify false
if [[ ! $3 == "-r" ]] ; then
echo -n "Pull from: "
read from
git pull $from
git checkout master
fi
}
function ovim(){ vim +"SessionOpen $@"; }
function ogvim(){ gvim +"SessionOpen $@"; }
function tsh(){
ssh $* -X
if which ponysay >/dev/null; then
ponysay "Connection closed!"
else
echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n"
fi
}
function k(){
if [[ $# > 1 ]] ; then
#More than 1 arguement
echo -n "Exec [mcvxX]: "
read a
if [[ $a == "m" ]] ; then
mv $@
elif [[ $a == "c" ]] ; then
cp $@
elif [[ $a == "v" ]] ; then
vim $@
elif [[ $a == "x" ]] ; then
rm "$@"
elif [[ $a == "XX" ]] ; then
rm -rf "$@"
fi
elif [ -d "$@" ] ; then
#cd then ls
cd "$@" && ls
2014-08-11 15:14:46 -04:00
elif [[ "$@" == "-" ]] ; then
#Because if this isn't here, k - won't work
cd - && ls
elif [ -f "$@" ] ; then
#Extract if it's extractable
case $1 in
*.tar.xz) tar xvf $1 ;;
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar 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 ;;
*) vim $1
esac
else
echo -n "Exec [dcvfxX]: "
read a
if [[ $a == "d" ]] ; then
#Create directory
mkdir $@
elif [[ $a == "c" ]] ; then
#Create directory and cd into it
mkdir $@
cd $@
elif [[ $a == "v" ]] ; then
#Edit with vim
vim "$@"
elif [[ $a == "f" ]] ; then
#Open with Firefox
firefox "$@"
elif [[ $a == "x" ]] ; then
#rm file
rm "$@"
elif [[ $a == "X" ]] ; then
#rm directory
rmdir "$@"
elif [[ $a == "XX" ]] ; then
#rm -rf everything
rm -rf "$@"
fi
fi
}