diff --git a/bashrc b/bashrc index fc4baeb..bb6fd75 100644 --- a/bashrc +++ b/bashrc @@ -80,7 +80,7 @@ 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='. ~/.bashrc' alias install='sudo apt-get install' -alias search='sudo apt-cache search' +alias search='apt-cache search' alias remove='sudo apt-get remove' alias update='sudo apt-get update' alias upgrade='sudo apt-get upgrade' @@ -144,7 +144,21 @@ function k(){ elif [ "$@" == "-" ] ; then cd - && ls elif [ -f "$@" ] ; then - vim "$@" + 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 "Create? " read a diff --git a/sync.sh b/sync.sh index 3ae9270..e0defde 100755 --- a/sync.sh +++ b/sync.sh @@ -59,15 +59,16 @@ while getopts ":hbsdtclw" VALUE "$@"; do if [ "$VALUE" = "c" ] ; then echo "Syncing config files" if which trash >/dev/null; then - trash ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.bashrc ~/.pylintrc + trash ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.bashrc ~/.pylintrc ~/.zshrc else - rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.bashrc ~/.pylintrc + rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.bashrc ~/.pylintrc ~/.zshrc fi ln -s ${PWD}/pylintrc ~/.pylintrc ln -s ${PWD}/vimrc ~/.vimrc ln -s ${PWD}/vimperatorrc ~/.vimperatorrc ln -s ${PWD}/gitconfig ~/.gitconfig ln -s ${PWD}/bashrc ~/.bashrc + ln -s ${PWD}/zshrc ~/.zshrc fi if [ "$VALUE" = "l" ] ; then echo "Linking standard directories..." diff --git a/tmux.conf b/tmux.conf index 1ed4cf2..05416ce 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,3 +1,4 @@ +set-option -g default-shell /bin/zsh set -g status-bg black set -g status-fg white set -g status-left '#[fg=green]#H' diff --git a/vimrc b/vimrc index 43ac64d..4721d94 100644 --- a/vimrc +++ b/vimrc @@ -121,7 +121,7 @@ nnoremap w nnoremap W nnoremap :bp nnoremap :bn -nnoremap z _| +nnoremap z _\| nnoremap bun G?Bundleyyjp$hdi'"+gP0Wl3d/\/xjyyP$"+gp:nohlsearch:up:BundleInstall nnoremap :CtrlPFunky nnoremap :set invpaste diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..192b260 --- /dev/null +++ b/zshrc @@ -0,0 +1,201 @@ +# Path to your oh-my-zsh installation. +export ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load. +# Look in ~/.oh-my-zsh/themes/ +# Optionally, if you set this to "random", it'll load a random theme each +# time that oh-my-zsh is loaded. +ZSH_THEME="af-magic" + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="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" +HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +export PATH="/home/stonewareslord/.autojump/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# ssh +# export SSH_KEY_PATH="~/.ssh/dsa_id" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" +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 vim='vim +"au BufWritePost .vimrc so ~/.vimrc" +"au BufWritePost vimrc so ~/.vimrc"' +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' +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" +alias g="git $@" +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 + 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 + 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 + vim "$@" + elif [ -d "$@" ] ; then + cd "$@" && ls + + elif [ "$@" -eq "-" ] ; then + cd - && ls + elif [ -f "$@" ] ; then + 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 "Create? " + read a + if [ ! -z $a ] ; then + vim "$@" + fi + fi +} +function mcl(){ mkdir "$@"&&cl "$@"; }