dotfiles

My opinionated dotfiles
git clone git://git.erethon.com/dotfiles
Log | Files | Refs

commit ef400bbd44dfad4f07f0d91b2ecdbb2363901c5f
parent f70e1017411223db970b10a905a05ba564f354f3
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Sun, 13 Dec 2015 02:38:40 +0200

Init zsh dotfiles

Diffstat:
.aliases | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.zshrc | 27+++++++++++++++++++++++++++
setup.sh | 2++
3 files changed, 107 insertions(+), 0 deletions(-)

diff --git a/.aliases b/.aliases @@ -0,0 +1,78 @@ +# go back x directories +b() { + str="" + count=0 + while [ "$count" -lt "$1" ]; + do + str=$str"../" + let count=count+1 + done + cd $str +} + +#Extract almost any archive +extract () { + if [ -f $1 ] ; then + case $1 in + *.tar.bz2) tar xjf $1 ;; + *.tar.gz) tar xzf $1 ;; + *.bz2) bunzip2 $1 ;; + *.rar) unrar e $1 ;; + *.gz) gunzip $1 ;; + *.tar) tar xf $1 ;; + *.tbz2) tar xjf $1 ;; + *.tgz) tar xzf $1 ;; + *.zip) unzip $1 ;; + *.Z) uncompress $1 ;; + *.7z) p7zip -d $1 ;; + *) echo "'$1' cannot be extracted via extract()" ;; + esac + else + echo "'$1' is not a valid file" + fi +} + +#Instant server +servedir(){ + python -m SimpleHTTPServer $1 +} + +shutd(){ + echo $((date| cut -d' ' -f 1-5 && uptime | cut -d' ' -f 3-5 | cut -d',' -f 1 ) | tr "\n" " ") >> ~/.uptime.txt + sudo shutdown -h now +} + +wifi(){ + sudo rfkill unblock wifi + sleep 1 + sudo ifconfig wlan0 down + sudo macchanger -r wlan0 + sudo ifconfig wlan0 up + sudo service wicd start + wicd-curses +} + +#Clear terminal +alias c="clear" + +alias clip="xclip -selection clipboard" +alias burn="shred -n 3 -u " +alias monitor="xrandr --output DVI-I-1 --mode 1920x1080 --left-of VGA1" +alias monitor2="xrandr --output LVDS1 --mode 1024x600; xrandr --output VGA1 --mode 1920x1080 --left-of LVDS1" + +#Common typo +alias les="less" + +#Open stdout in vim +alias vr="vim -R -" + +#Pretty print json +alias json="python -mjson.tool" + +#Common programs alias +alias h="history | grep" +alias less="less -R" +alias ls="ls --color=auto" + +alias iptv="iptables -L -v -n --line-numbers" +alias iptvs="ip6tables -L -v -n --line-numbers" diff --git a/.zshrc b/.zshrc @@ -0,0 +1,27 @@ +# Modules +autoload -U promptinit colors compinit +promptinit +colors +compinit + +# History related settings +HISTFILE=~/.histfile +HISTSIZE=1000 +SAVEHIST=1000 + +# Use vim keybinds +bindkey -v +bindkey "^R" history-incremental-search-backward + +# Prompt style +prompt off +source ~/Code/zsh-git-prompt/zshrc.sh # Enable git prompt +GIT_PROMPT_EXECUTABLE="haskell" # Use haskell for git prompt +PROMPT='%{%(#~$fg[magenta]~$fg[green])%}%~%b$(git_super_status) %# ' + +# Source aliases +[ -f .aliases ] && source .aliases +[ -f .config/ls_col ] && source .config/ls_col + +# Vars +export GPG_TTY=$(tty) diff --git a/setup.sh b/setup.sh @@ -11,3 +11,5 @@ cp .bash_aliases ~ cp .config/ls_col ~/.config cp .vim/colors/* ~/.vim/colors cp .Xdefaults ~/.Xdefaults +cp .aliases ~/.aliases +cp .zshrc ~/.zshrc