-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path_zshrc
More file actions
77 lines (62 loc) · 2.42 KB
/
_zshrc
File metadata and controls
77 lines (62 loc) · 2.42 KB
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
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Load environment variables from ~/.env if it exists
if [[ -f "$HOME/.env" && -r "$HOME/.env" ]]; then
# Only load files owned by current user with secure permissions
if [[ "$(stat -f %Su "$HOME/.env")" == "$(whoami)" ]] && [[ "$(stat -f %Mp%Lp "$HOME/.env")" -le 600 ]]; then
set -a # automatically export all variables
source "$HOME/.env"
set +a # disable auto-export
else
echo "Warning: ~/.env has insecure permissions or ownership" >&2
fi
fi
# Homebrew setup (macOS only, works for both Intel and Apple Silicon)
if [[ "$OSTYPE" == "darwin"* ]]; then
if [[ -f /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)" # Apple Silicon
elif [[ -f /usr/local/bin/brew ]]; then
eval "$(/usr/local/bin/brew shellenv)" # Intel Mac
fi
fi
source ~/.zplug/init.zsh
export TERM="xterm-256color"
ZSH_THEME="powerlevel10k/powerlevel10k"
zplug "zsh-users/zsh-autosuggestions"
zplug "supercrabtree/k"
zplug "plugins/git", from:oh-my-zsh
zplug romkatv/powerlevel10k, as:theme, depth:1
# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
zplug load
alias gw="./gradlew"
# tmux aliases
alias ta='tmux attach -t'
alias tl='tmux ls'
alias tn='tmux new -s'
DEFAULT_USER="$(whoami)"
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#ddd"
eval "$(mise activate zsh)"
export ANDROID_HOME="$HOME/Library/Android/sdk/"
export NDK="/opt/homebrew/share/android-ndk"
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH="$HOME/.local/bin:$PATH"
export PATH="/opt/homebrew/opt/sqlite/bin:$PATH"
. "$HOME/.local/bin/env"
export PATH="$HOME/.opencode/bin:$PATH"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export LC_ALL=en_US.UTF-8
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh