guest@dotshare [~/groups/shells/zsh] $ ls es-useless-zsh/ | cat

e's useless zsh (raw, dl)

erkin Feb 06, 2012 (shells/zsh)
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
HISTFILE=~/.zsh_history
HISTSIZE=1000
SAVEHIST=1000
bindkey -e
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward
# key bindings
bindkey "\e[1~" beginning-of-line # Home
bindkey "\e[4~" end-of-line # End
bindkey "\e[5~" beginning-of-history # PageUp
bindkey "\e[6~" end-of-history # PageDown
bindkey "\e[2~" quoted-insert # Ins
bindkey "\e[3~" delete-char # Del
bindkey "\e[5C" forward-word
bindkey "\eOc" emacs-forward-word
bindkey "\e[5D" backward-word
bindkey "\eOd" emacs-backward-word
bindkey "\e\e[C" forward-word
bindkey "\e\e[D" backward-word
bindkey "\e[Z" reverse-menu-complete # Shift+Tab
# for rxvt
bindkey "\e[7~" beginning-of-line # Home
bindkey "\e[8~" end-of-line # End
# for non RH/Debian xterm, can't hurt for RH/Debian xterm
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
# for freebsd console
bindkey "\e[H" beginning-of-line
bindkey "\e[F" end-of-line
# completion in the middle of a line
bindkey '^i' expand-or-complete-prefix

export EDITOR='emacsclient'

alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias mkdir='mkdir -p'
alias rm='rm -I'
alias reboot='sudo reboot'
alias halt='sudo halt'
alias pacman='sudo pacman'
alias visudo='sudo EDITOR="emacs -nw" visudo'
alias wiki='java -jar ~/bin/stiki.jar'
alias sedit='sudo /usr/bin/emacs -nw'
alias edit='/usr/bin/emacsclient -nw'
alias 'rc.d'='sudo rc.d'
alias dir="ls -lAhF"
alias hs="runhaskell"
alias xlinks="xlinks -g"
alias unmount=umount

zstyle :compinstall filename '/home/erkin/.zshrc'
autoload -Uz compinit
compinit
setopt completealiases

export PS1="$(print '%{\e[1;36m%}%n%{\e[0m%} %{\e[1;36m%}%1~%{\e[0m%} %{\e[1;32m%}$%{\e[0m%}') "


#mine(){
 # bash /home/erkin/bin/wom/wom.sh & > /dev/null
 # (cd ~/bin/wom/ && bash wom.sh > /dev/null ; cd - > /dev/null) &
#}

paket(){
 #cd ~/pkg && makepkg -si ; cd - > /dev/null
 cd ~/tmp/pkg
 wget "$*"
 tar xvf *.tar.gz
 mv */* ~/pkg
 /bin/rm -rf *
 cd ~/pkg
 makepkg -si
 cd ~
}

man() {
	env \
		LESS_TERMCAP_mb=$(printf "\e[1;37m") \
		LESS_TERMCAP_md=$(printf "\e[1;37m") \
		LESS_TERMCAP_me=$(printf "\e[0m") \
		LESS_TERMCAP_se=$(printf "\e[0m") \
		LESS_TERMCAP_so=$(printf "\e[1;47;30m") \
		LESS_TERMCAP_ue=$(printf "\e[0m") \
		LESS_TERMCAP_us=$(printf "\e[0;36m") \
			man "$@"
}

update(){
 sudo pacman -Syu --noconfirm
}

run(){
 ./"$*"
}

ed(){
 touch ed.hup;while :;do read x;echo ?;done 
}

#clean(){
# rm *~ \#*# *.old .*~ .*.old *.bak .*.bak
#}

hreddit(){
 cd ~/bin/hreddit/ ; ./Main ; cd - > /dev/null
}

#desura(){
# cd ~/var/games/desura/bin/ ; run desura &
#}

logse(){most /home/erkin/.xchat2/xchatlogs/esperchat-\#$*.log}
logsf(){most /home/erkin/.xchat2/xchatlogs/FreeNode-\#$*.log}
logsearch(){grep -ri $* /home/erkin/.xchat2/xchatlogs/}
womlogs(){grep -i $* /home/erkin/bin/wom/*.log}
# gismu(){grep -i " $* " /home/erkin/lib/gismu.txt}
# cmavo(){grep -i " $* " /home/erkin/lib/cmavo.txt}
# lujvo(){grep -i " $* " /home/erkin/lib/lujvo.txt}
ponytime(){bash /home/erkin/pony/ponytime/ponytime}
# Easier archive extraction
extr(){
    if [ -f $1 ] ; then
        case $1 in
            *.tar.bz2)      tar xvjf $1   ;;
            *.tar.gz)       tar xvzf $1   ;;
	    *.tar.xz)       tar xvJf $1   ;;
            *.bz2)          bunzip2 $1    ;;
            *.rar)          unrar x $1    ;;
            *.gz)           gunzip $1     ;;
            *.tar)          tar xvf $1    ;;
            *.tbz2)         tar xvjf $1   ;;
            *.tgz)          tar xvzf $1   ;;
	    *.txz)          tar xvJf $1   ;;
            *.rar)          unrar $1      ;;
            *.zip)          unzip $1      ;;
            *.Z)            uncompress $1 ;;
            *.7z)           7z e $1       ;;
	    *)              echo "'$1' cannot be extracted via extr()" ;;
	esac
    else
        echo "'$1' is not a valid file"
    fi
}

export PAGER='less -X -M'
export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
export LESS=' -R '

CLICK TO VIEW

x