-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
96 lines (84 loc) · 3.07 KB
/
.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
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
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Created by Zap installer
[ -f "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh" ] && source "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh"
plug "zsh-users/zsh-autosuggestions"
plug "zap-zsh/supercharge"
plug "zsh-users/zsh-syntax-highlighting"
plug "zsh-users/zsh-history-substring-search"
plug "zap-zsh/vim"
plug "zap-zsh/nvm"
plug "chrishrb/zsh-kubectl"
plug "wintermi/zsh-rust"
plug "wintermi/zsh-starship"
plug "zap-zsh/exa"
plug "Aloxaf/fzf-tab"
# disable sort when completing `git checkout`
zstyle ':completion:*:git-checkout:*' sort false
# set descriptions format to enable group support
# NOTE: don't use escape sequences here, fzf-tab will ignore them
zstyle ':completion:*:descriptions' format '[%d]'
# set list-colors to enable filename colorizing
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# force zsh not to show completion menu, which allows fzf-tab to capture the unambiguous prefix
zstyle ':completion:*' menu no
# preview directory's content with eza when completing cd
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
# switch group using `<` and `>`
zstyle ':fzf-tab:*' switch-group '<' '>'
plug "junegunn/fzf-git.sh"
source $ZAP_PLUGIN_DIR/fzf-git.sh/fzf-git.sh
__fix_fzf_git_keybindings() {
local m o
for o in "$@"; do
eval "fzf-git-$o-widget() { local result=\$(_fzf_git_$o | __fzf_git_join); zle reset-prompt; LBUFFER+=\$result }"
eval "zle -N fzf-git-$o-widget"
for m in emacs vicmd viins; do
eval "bindkey -M $m '^g^${o[1]}' fzf-git-$o-widget"
eval "bindkey -M $m '^g${o[1]}' fzf-git-$o-widget"
done
done
}
__fix_fzf_git_keybindings files branches tags remotes hashes stashes lreflogs each_ref
# Load and initialise completion system
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
fi
autoload -U +X bashcompinit && bashcompinit
autoload -Uz compinit && compinit
complete -o nospace -C /opt/homebrew/bin/terraform terraform
# setup jenv
eval "$(jenv init -)"
# Standard alaises
alias awsd="source _awsd"
alias vi="nvim"
alias cat="bat"
alias ls='eza --hyperlink --group-directories-first --icons'
stty -ixon
function auth_wrkr () {
if [ -z "$GITLAB_ACCESS_TOKEN" ]; then
echo authorizing wrkr - gitlab
op signin --account complypath.1password.com
export GITLAB_ACCESS_TOKEN=$(op item get GITLAB_ACCESS_TOKEN --account complypath.1password.com --fields notesPlain)
export TF_TOKEN_gitlab_com=$GITLAB_ACCESS_TOKEN
fi
echo authorizing wrkr - aws nwo
aws-sso-util login https://wrkr.awsapps.com/start ap-southeast-2
if [ -z "$AWS_PROFILE" ]; then
export AWS_PROFILE=wrkr.infrastructure-shared-sandbox.ap-southeast-2.AWSAdministratorAccess
fi
export TFENV_TERRAFORM_VERSION=1.5.7
}
function start_wrkr () {
auth_wrkr
tmuxinator start wrkr
}
# pnpm
export PNPM_HOME="/Users/smacintyre/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"