]> git.rmz.io Git - dotfiles.git/blob - zshrc
fix globbing in zsh
[dotfiles.git] / zshrc
1 # configure history
2 HISTFILE=~/.histfile
3 HISTSIZE=1000
4 SAVEHIST=2000
5 setopt hist_ignore_dups
6 setopt hist_ignore_space
7 setopt append_history
8 setopt inc_append_history
9 setopt extended_history
10
11 # misc
12 setopt beep
13 setopt extendedglob
14 setopt csh_nullglob # if glob does not match, remove pattern, if no glob matches print error
15 setopt numeric_glob_sort # sort numerically not lexically
16 setopt noclobber # don't allow overwriting files with '>', use '>!' instead
17 setopt notify
18 setopt rcquotes # echo 'don''t'; prints don't
19
20 # key bindings
21 bindkey -e # emacs key bindings, vi is weird
22 [[ -r ~/.zsh/bindkeyrc ]] && source ~/.zsh/bindkeyrc
23
24 # Completion
25 zstyle :compinstall filename '/home/ramsi/.zshrc'
26 zstyle ':completion:*' list-colors ''
27
28 setopt complete_in_word # allow completion in the middle of a word
29 autoload -Uz compinit
30 compinit
31
32 # populate path
33 typeset -U path # make path a unique array
34 [[ -d ~/bin ]] && path=(~/bin $path)
35
36 # load my functions
37 typeset -U fpath # make fpath a unique array
38 [[ -d ~/.zsh/functions ]] && fpath=(~/.zsh/functions $fpath)
39 autoload -U ${fpath[1]}/*(:t) # loads all functions in the first element of fpath
40
41 # source aliases
42 [[ -f ~/.aliasesrc ]] && source ~/.aliasesrc
43
44 # set up prompt
45 autoload -U colors && colors
46 [[ $(hostname) == "tardis" ]] && hostcolor=red
47 [[ $(hostname) == "shada" ]] && hostcolor=green
48 PROMPT="%(?..%{$fg_bold[white]%}[%?])%{$reset_color%}[%D{%k:%M} %n@%{$fg[$hostcolor]%}%m%{$reset_color%}]%# "
49 RPROMPT="%{$fg[green]%}%~%{$reset_color%}"
50
51 # make cd act like pushd
52 DIRSTACKSIZE=10 # number of dirs to remember
53 setopt auto_pushd # cd acts like pushd
54 setopt pushd_minus # inverts the meaning of cp -1 and cp +1
55 setopt pushd_silent # don't print dir stack everytime
56 setopt pushd_to_home # pushd with no argumens pushes to ~
57 setopt pushd_ignore_dups # ignore dups in pushd/cd
58 alias dh='dirs -v' # show numbers with dirs
59
60 setopt auto_cd # if no command matches the input, try to cd into it; .. = cd ..
61
62 # set search path for cd
63 cdpath=(~ /mnt)
64
65 # set up a few named directories
66 hash -d Skaro=/mnt/Skaro
67 hash -d ccr=~/ccr
68 hash -d src=~/src
69 hash -d chroot_testing=/buildsystem/testing/buildroot
70 hash -d chroot_master=/buildsystem/master/buildroot
71 hash -d chroot_lib32=/buildsystem/lib32/buildroot
72 hash -d wineprefixes=/mnt/sdd5/wineprefixes