-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
66 lines (53 loc) · 1.75 KB
/
dot_zshrc
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
setopt +o nomatch
export ZSH=$HOME/.oh-my-zsh
# oh-my-ZSH configuration.
ZSH_THEME="avit"
DISABLE_AUTO_TITLE="true"
plugins=(asdf vi-mode fzf fasd git dotenv)
source $ZSH/oh-my-zsh.sh
# VI Mode
export KEYTIMEOUT=1
export LC_ALL=en_US.UTF-8
export EDITOR='nvim'
# $PATH manipulation
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
# Pulling in more configuration:
## Secrets files
for f in ~/.secrets/*; do
test -f "$f" || continue
source $f
done
## Source additional shell configs
for f in ~/.conf.rc/*; do
test -f "$f" || continue
source $f
done
## Source additional ZSH configs
for f in ~/.config/zsh/config.d/*.zsh; do
test -f "$f" || continue
source $f
done
## Library-specific configs
#### FZF
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
[ -f /usr/share/doc/fzf/examples/key-bindings.zsh ] && source /usr/share/doc/fzf/examples/key-bindings.zsh
[ -f /usr/share/doc/fzf/examples/completion.zsh ] && source /usr/share/doc/fzf/examples/completion.zsh
#### Other
[ -f ~/.cargo/env ] && source ~/.cargo/env
# Keybindings
alias vim='nvim'
alias pairsession-open='tmux -2 -S /tmp/pair new-session -t pair -s pair -d && chown $(whoami):pair /tmp/pair && pairsession-attach'
alias pairsession-attach='tmux -2 -S /tmp/pair attach -t pair'
alias pg-start='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
alias pg-stop='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log stop'
alias gcof='git branch | fzf | xargs -n1 git checkout'
# ZSH completion caching
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
# Custom functions
## better zz from fasd
unalias zz
function zz() {
local dir
dir="$(fasd -Rdl "$*" | fzf --query="$*" -1 -0 --no-sort +m)" && cd "${dir}" || return 1
}