]> git.rmz.io Git - dotfiles.git/blob - zshrc
lazyvim: delete noice
[dotfiles.git] / zshrc
1 # Path to config files
2 ZSH=$XDG_CONFIG_HOME/zsh
3 ZSH_DATA=$XDG_DATA_HOME/zsh
4 ZSH_CACHE=$XDG_CACHE_HOME/zsh
5 [[ ! -d "$ZSH" ]] && echo "Missing config dir: '$ZSH'" && return
6 [[ ! -d "$ZSH_CACHE" ]] && echo "Missing cache dir: '$ZSH_CACHE'" && return
7 [[ ! -d "$ZSH_DATA" ]] && echo "Missing data dir: '$ZSH_DATA'" && return
8
9 # populate path (order matters)
10 typeset -U path # make path a unique array
11 # osx gnu utils (installed via brew)
12 if (( $+commands[brew] )); then
13 for pkg in coreutils findutils gnu-sed make; do
14 [[ -d $(brew --prefix $pkg)/libexec/gnubin ]] && path=($(brew --prefix $pkg)/libexec/gnubin $path)
15 done
16 fi
17 # osx pip 3.7 install
18 [[ -d ~/Library/Python/3.7/bin ]] && path=(~/Library/Python/3.7/bin $path)
19 # personal scripts
20 [[ -d ~/.local/bin ]] && path=(~/.local/bin $path)
21 [[ -d ~/bin ]] && path=(~/bin $path)
22 # android
23 [[ -d /opt/android-sdk ]] && path=($path /opt/android-sdk/platform-tools)
24
25 # load my functions
26 typeset -U fpath # make fpath a unique array
27 [[ -d $ZSH/functions ]] && fpath=($ZSH/functions $fpath)
28 autoload -U ${fpath[1]}/*(:t) # loads all functions in the first element of fpath
29
30 # Load all of the config files in $ZSH/lib that end in .zsh
31 for config_file ($ZSH/lib/*.zsh); do
32 source $config_file
33 done
34
35 # Set name of the theme to load.
36 # Look in $ZSH/themes
37 ZSH_THEME="ramsi"
38 [[ -f "$ZSH/themes/${ZSH_THEME}.zsh-theme" ]] && source "$ZSH/themes/${ZSH_THEME}.zsh-theme"
39
40 # initialise completion
41 autoload -U compinit; compinit -d "$ZSH_CACHE/zcompdump"
42
43 # miscelaneous options
44 setopt extendedglob
45 setopt nonomatch # if glob does not match, pass it to the command
46 setopt numeric_glob_sort # sort numerically not lexically
47 setopt noclobber # don't allow overwriting files with '>', use '>!' instead
48 setopt notify
49 setopt rcquotes # echo 'don''t'; prints don't
50 setopt dvorak # correct_all uses dvorak
51 setopt rematch_pcre # use perl regexp
52
53 # disable flow control
54 setopt noflowcontrol
55 stty -ixon
56
57 # source aliases
58 [[ -f $XDG_CONFIG_HOME/aliases ]] && source $XDG_CONFIG_HOME/aliases
59 for alias_file ($ZSH/aliases/*.zsh); do
60 source $alias_file
61 done
62
63 # set up a few named directories
64 hash -d fook=/mnt/fook
65 hash -d src=~/src
66
67 # fpp named dirs
68 hash -d evk=~/src/fpp/evk
69 hash -d fpp=~/src/fpp