# 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 }