-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
112 lines (87 loc) · 2.49 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# zsh
# source /opt/homebrew/share/zsh-autocomplete/zsh-autocomplete.plugin.zsh
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
autoload -U select-word-style
select-word-style bash
bindkey '^F' autosuggest-accept
stty -ixon # Disable XON/XOFF flow control to free up Ctrl+Q
exit_on_ctrl_q() {
exit
}
zle -N exit_on_ctrl_q
bindkey '^Q' exit_on_ctrl_q
# Show dotfiles
setopt globdots
# Prevent Ctrl-D from exiting window
setopt IGNORE_EOF
delete_word_backwards() {
# local WORDCHARS='~!#$%^&*(){}[]<>?+;'
local WORDCHARS="${WORDCHARS:s#/#}"
zle backward-delete-word
}
zle -N delete_word_backwards
bindkey '\e^?' delete_word_backwards
# Set PATH, MANPATH, etc., for Homebrew.
eval "$(/opt/homebrew/bin/brew shellenv)"
. "$HOME/.cargo/env"
[ -f ~/.config/fzf/.fzf.zsh ] && source ~/.config/fzf/.fzf.zsh
export XDG_CONFIG_HOME="$HOME/.config"
export EDITOR="nvim"
# Aliases
function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
yazi "$@" --cwd-file="$tmp"
if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
}
alias v="nvim"
alias n="nvim"
alias p="pnpm"
alias g="gitui"
alias d="lazydocker"
alias ls="lsd -a"
alias gs="git status"
alias gd="git diff"
alias gl="git log"
alias gck="git checkout"
alias ga="git add ."
alias ga_="git add"
alias gc="git commit -m"
alias gp="git push origin HEAD"
alias gap="ga && gc wip && gp"
alias gss="git stash"
alias gsv="git add . && git stash"
alias gsp="git stash pop"
alias gca="git commit --amend --no-edit"
alias ds='discordo --token "$DISCORD_TOKEN"'
alias tg="nchat"
# fnm
eval "$(fnm env --use-on-cd)"
# pure prompt
fpath+=$HOME/.zsh/pure
autoload -U promptinit; promptinit
prompt pure
# alt-left / alt-right
bindkey "^[[1;3C" forward-word
bindkey "^[[1;3D" backward-word
# init zoxide to add "z" command
eval "$(zoxide init --cmd cd zsh)"
# pnpm
export PNPM_HOME="/Users/razen/Library/pnpm"
export PATH="$PNPM_HOME:$PATH"
export PATH="$PATH:$(pnpm --global bin)"
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
export JAVA_HOME="$(/usr/libexec/java_home)"
export npm_config_target_arch=x64
# AI API Keys
source ~/.zsh_env_vars
# export GEMINI_API_KEY="GEMINI_API_KEY"
# export DEEPSEEK_API_KEY="DEEPSEEK_API_KEY"
# export OPENAI_API_KEY="OPENAI_API_KEY"
# export ANTHROPIC_API_KEY="ANTHROPIC_API_KEY"