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 | # Stolen heavily from StackOverflow
# ZSH Modules
autoload -U compinit promptinit zsh-mime-setup colors
compinit
promptinit
zsh-mime-setup
colors
# Options
# why type cd dir, just type dir
setopt AUTO_CD
# No unnecessary slashes
setopt AUTO_REMOVE_SLASH
# pipe to multiple outputs
setopt MULTIOS
# spell check commands
setopt CORRECT
# expand glos when possible
setopt GLOB_COMPLETE
# case insensitive glob
setopt NO_CASE_GLOB
# extended glob
setopt EXTENDED_GLOB
setopt NUMERIC_GLOB_SORT
# no beeps
setopt NO_BEEP
# careful with rm
setopt RM_STAR_WAIT
# color ls
eval `dircolors -b`
# append history, don't overwrite
setopt APPEND_HISTORY
# no duplicate entries
setopt HIST_IGNORE_DUPS
# save hist space
setopt HIST_REDUCE_BLANKS
# Completion
# faster?
zstyle ':completion::complete:*' use-cache 1
# case insensitive
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:*' verbose yes
# for PID
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
# color completion
zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31"
# separate man page sections
zstyle ':completion"*"manuals' separate-sections true
# don't complete current directory
zstyle ':completion:*' ignore-parents parent pwd
# History
HISTFILE=~/.histfile
SAVEHIST=10000
HISTSIZE=10000
# Exports
export LANG=en_US
export XDG_DATA_HOME=/home/michael/.config
export ARCH=x86_64
export EDITOR=vim
export BROWSER=firefox
export GREP_COLOR="1;33"
export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl:/home/michael/bin
# Zsh prompt
PROMPT="%{$fg[blue]%}%d%{$reset_color%}%% "
# Aliases
alias la='ls -a'
alias lh='ls -lh'
alias lah='ls -lah'
alias -g ls='ls --classify --tabsize=0 --literal --color=auto --show-control-chars --human-readable --group-directories-first'
alias -g G='| grep'
alias shutdown='sudo shutdown -h now'
alias reboot='sudo reboot'
alias pac='pacman-color'
alias spac='sudo pacman-color'
alias makecdiso='sudo dd if=/dev/cdrom of=/home/michael/cdimage.iso'
alias mplayer='mplayer -msgcolor'
alias locate='locate -i -e'
alias wicd='wicd-curses'
alias weechat='weechat-curses'
# Suffixes
alias -s pdf='apvlv'
alias -s {jpg,png,gif}='feh'
alias -s {wmv,mp4,avi,flv,mkv,mp3,ogg,flac,wav}='mplayer'
alias -s py='python'
# Make coreutils more verbose
for c in cp rm chmod chown rename; do
alias $c="$c -v"
done
# Extract files
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 â<80><9C>donâ<80><99>t know how to extract â<80><98>$1â<80>²â<80>¦â<80><9D> ;;
esac
else
echo â<80><9C>â<80><98>$1â<80>² is not a valid file!â<80><9D>
fi
}
# ls on cd
cd() {builtin cd $@; ls }
|
x