#!/usr/bin/env zsh # # zshrc for zsh on my Arch Linux ThinkPad # http://rubenschade.com/dotfiles/.zshrc # Peace, health and happiness. The Bird is The Word! # # Making the switch after 12+ years of tcsh, so probably a lot of redundandy # or better ways of doing things here. Refuse to use cshjunkiequotes though! # zstyle :compinstall filename '/home/rubenerd/.zshrc' autoload -Uz compinit compinit ## # POINTLESS STUFF # Highly important to put this first # echo '\nHello Ruben! ^_^' alias esteem='echo You are awesome!' ## # SHELL OPTIONS # Many of these are similar to tcsh # bindkey -v # vim key bindings instead of emacs setopt autocd extendedglob nomatch notify setopt autopushd pushdminus pushdsilent pushdtohome setopt correctall setopt cdablevars setopt ignoreeof setopt nobeep setopt noclobber umask 022 ## # HISTORY # Save history for session, but not persistently (potential security hole) # export HISTSIZE=10240 export SAVEHIST=0 ## # PATH # Prevents duplication by only adding unique array elements to our path # Pretty cool trick :) # typeset -U path path=(. /opt/local/bin /opt/local/sbin /usr/local/bin /usr/local/sbin /usr/bin/ /usr/sbin /bin /sbin $path) ## # PROMPT # I've always preferred simple prompts. Also prefer setting text to bold, then # customising how "bold" text appears in my terminal emulator. Much less messy # # FORMAT # return value, tty:history number, 24 localtime w/o seconds, name@machie, pwd, # "ready" (8bit nostalgia! XD) permission # # "$" allows interpretation, which I use for newlines # export PROMPT=$'\n%Bret:%? %l:%h %T %n@%m %~%b\nready %# ' ## # ENVIRONMENT VARIABLES # Copied from my tcshrc, not sure if all are needed in zsh # export BLOCKSIZE=m export BROWSER=firefox export CLICOLOR=1 export EDITOR=vim export PAGER=less export VISUAL=vim ## # AUTOMATIC EXTENSIONS # Thanks to the Arch Linux wiki for the idea, brilliance! # alias -s bz2='tar -xjvf' alias -s gz='tar -xzvf' alias -s rz='rzip -d' alias -s xz='unxz' alias -s c=$EDITOR alias -s cpp=$EDITOR alias -s h=$EDITOR alias -s java=$EDITOR alias -s m=$EDITORR alias -s txt=$EDITOR alias -s au=$BROWSER alias -s com=$BROWSER alias -s html=$BROWSER alias -s net=$BROWSER alias -s org=$BROWSER alias -s sg=$BROWSER alias -s odf=soffice alias -s odg=soffice alias -s ods=soffice alias -s odp=soffice alias -s doc=soffce alias -s ppt=soffice alias -s xls=soffice alias -s gif='ristretto' alias -s jpg='ristretto' alias -s png='ristretto' ## # ALIASES # Mostly to protect me from myself ;) # alias bz='bzip2 -zf9vv' alias cp='cp -i' alias f='finger' alias gz='gz -f9v' alias emacs='vim' # heh heh ^^; alias help='apropos' alias mv='mv -i' alias nv='nvi' alias perl='perl -w' alias ping='ping -c5' alias python='python -T3' alias rm='rm -i' alias ruby='ruby -w' alias t='touch' alias uname='uname -mrs' alias vi='vim' alias x='exit' alias xz='xz -zf9evv' ## # ALIASES FOR GNU LS # If I move to zsh for FreeBSD, will need conditional to change colour to -G # alias la='ls -aF --color=auto' alias ll='ls -alF --color=auto' alias ls='ls -FG --color=auto' ## # ALIASES FOR ARCH PACMAN # Verbosity is my friend # alias pm='su pacman -Sv' alias pq='su pacman -Qv' alias pu='su pacman -Syuv --needed' ## # EOF #