]> git.rmz.io Git - dotfiles.git/blob - zshrc
7ad8443cfc8191eb977a4336e035d76e74709e6d
[dotfiles.git] / zshrc
1 # Path to config files
2 ZSH=$XDG_CONFIG_HOME/zsh
3 [[ ! -d "$ZSH" ]] && echo "Missing config dir: '$ZSH'" && return
4
5 # Load all of the config files in $ZSH/lib that end in .zsh
6 for config_file ($ZSH/lib/*.zsh); do
7 source $config_file
8 done
9
10 # Set name of the theme to load.
11 # Look in $ZSH/themes
12 ZSH_THEME="ramsi"
13 [[ -f "$ZSH/themes/${ZSH_THEME}.zsh-theme" ]] && source "$ZSH/themes/${ZSH_THEME}.zsh-theme"
14
15 # load my functions
16 typeset -U fpath # make fpath a unique array
17 [[ -d ~/.zsh/functions ]] && fpath=(~/.zsh/functions $fpath)
18 autoload -U ${fpath[1]}/*(:t) # loads all functions in the first element of fpath
19
20 # initialise completion
21 [[ -d "$XDG_CACHE_HOME/zsh" ]] || mkdir -p "$XDG_CACHE_HOME/zsh"
22 autoload -U compinit; compinit -d "$XDG_CACHE_HOME/zsh/zcompdump"
23
24 # miscelaneous options
25 setopt extendedglob
26 setopt cshnullglob # if glob does not match, remove pattern, if no glob matches print error
27 setopt numeric_glob_sort # sort numerically not lexically
28 setopt noclobber # don't allow overwriting files with '>', use '>!' instead
29 setopt notify
30 setopt rcquotes # echo 'don''t'; prints don't
31 setopt dvorak # correct_all uses dvorak
32
33 # populate path
34 typeset -U path # make path a unique array
35 [[ -d ~/.local/bin ]] && path=(~/.local/bin $path)
36 [[ -d ~/bin ]] && path=(~/bin $path)
37 [[ -d /extra ]] && path=($path /extra/bin /extra/usr/bin /extra/sbin /extra/usr/sbin)
38 [[ -d /opt/android-sdk ]] && path=($path /opt/android-sdk/platform-tools)
39
40 # source aliases
41 [[ -f ~/.aliases ]] && source ~/.aliases
42 for alias_file ($ZSH/aliases/*.zsh); do
43 source $alias_file
44 done
45
46 # vim stuff
47 export EDITOR=vim
48 export VISUAL=vim
49 export BROWSER=dwb
50
51 # set up a few named directories
52 hash -d Skaro=/mnt/Skaro
53 hash -d ccr=~/ccr
54 hash -d src=~/src
55 hash -d chroot_testing=/buildsystem/testing/buildroot
56 hash -d chroot_master=/buildsystem/master/buildroot
57 hash -d chroot_lib32=/buildsystem/lib32/buildroot
58 hash -d wineprefixes=/mnt/data/wineprefixes
59 hash -d UniMaas=~/dropbox/Documents/UniMaas
60
61 # set some env variables
62 export _gamedir=/mnt/Skaro/Games/Linux/HumbleBundle
63
64 # ros
65 if [[ -f "/opt/ros/groovy/setup.zsh" ]]; then
66 export ROS_WORKSPACE=~/src/ros
67 export ROS_OS_OVERRIDE=arch
68 fi