summaryrefslogtreecommitdiffstats
path: root/zshrc
blob: fa7a73ec6bf1c9e5cabff59d930ea15a2f652b7a (plain)
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
# initialize zsh auto completion system
autoload -Uz compinit vcs_info; compinit
zmodload -i zsh/complist

# history settings
#HISTFILE=~/.histfile
SAVEHIST=0
HISTSIZE=1000

# no beep
setopt prompt_subst autocd
unsetopt beep

# sane keybindings
bindkey -e

# define colors
BLACK="%{"$'\033[01;30m'"%}"
GREEN="%{"$'\033[01;32m'"%}"
RED="%{"$'\033[01;31m'"%}"
YELLOW="%{"$'\033[01;33m'"%}"
BLUE="%{"$'\033[01;34m'"%}"
BOLD="%{"$'\033[01;39m'"%}"
NORM="%{"$'\033[00m'"%}"

# my prefered prompt with color
# %n = Username
# %m = Hostname
# %~ = Current Directory
# %# = Shell Icon % for User, # for root
PROMPT="${GREEN}%n@%m ${BLUE}%~ %# ${NORM}"

# VCS prompt on the right side
RPROMPT=$'$(vcs_info_wrapper)'

# enable color in some commands
eval "`dircolors -b`"
export LS_COLORS="$LS_COLORS*.wmv=01;35:"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias less="less -r"

# shortcut for some commands
alias l=ls
alias gq="background geeqie"
alias ev="background evince"

# vim: open multiple files in tabs by default
alias vim="vim -p"

# improved calender
alias cal="ccal -e -f"

# use mplayer2 instead of mplayer
alias mplayer="mplayer2"

# suffix aliases
alias -s jpg="background gpicview"
alias -s gif="background gpicview"
alias -s png="background gpicview"
alias -s svg="background gpicview"
alias -s pdf="background evince"
alias -s mkv="background mplayer2"
alias -s ogg="background mplayer2"
alias -s wmv="background mplayer2"
alias -s mpg="background mplayer2"
alias -s avi="background mplayer2"
alias -s mp4="background mplayer2"
alias -s exe="wine"
alias -s vala="vim"
alias -s txt="vim"
alias -s doc="oowriter"

# set default programs
export EDITOR=vim
export PAGER=vimpager
export BROWSER=chromium

# path /sbin for ifconfig etc.
export PATH=$PATH:/usr/sbin:/sbin:/var/lib/gems/1.8/bin

# function to set terminal title
title() {
      if [[ $TERM == "xterm" || $TERM == "rxvt" || $TERM == "screen" ]]; then
		print -Pn  "\e]2;$*\a"
      fi
}

# function to spawn a program in the background
background() {
	$1 $2 </dev/null >/dev/null 2>&1 &!
}

# get vcs info for the prompt
vcs_info_wrapper() {
	vcs_info
	echo "${vcs_info_msg_0_}"
}

# update title
function precmd { title "%n@%m %~" }

# menus for mutt and less
zstyle ':completion:*:*:less:*' menu yes select
zstyle ':completion:*:*:mutt:*' menu yes select

# menu for Processes
zstyle ':completion:*:*:*:*:processes' menu yes select
zstyle ':completion:*:*:*:*:processes' force-list always

# VCS Info
zstyle ':vcs_info:*' actionformats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
zstyle ':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f '
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
zstyle ':vcs_info:*' enable git cvs svn

# export some variables
export EMAIL="sre@ring0.de"
export DEBEMAIL="sre@debian.org"
export DEBSIGN_MAINT="sre@debian.org"
export DEBCHANGE_RELEASE_HEURISTIC=changelog