-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzshrc
More file actions
88 lines (72 loc) · 2.52 KB
/
zshrc
File metadata and controls
88 lines (72 loc) · 2.52 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
78
79
80
81
82
83
84
85
86
87
88
# ~/.zshrc
# Seongho's dotfiles — https://github.com/liveseongho/dotfiles
# ========== Guard: zsh only ==========
if [ -z "$ZSH_VERSION" ]; then
return 0 2>/dev/null || exit 0
fi
# ========== Fix fpath if zsh standard functions are missing ==========
if ! (( $fpath[(I)/usr/share/zsh/*/functions] )); then
local _zsh_funcs="/usr/share/zsh/${ZSH_VERSION}/functions"
[[ -d "$_zsh_funcs" ]] && fpath=("$_zsh_funcs" $fpath)
unset _zsh_funcs
fi
# Tab display: match vim's tabstop=4 (must be before p10k instant prompt)
tabs 4 2>/dev/null
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
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
# ========== Oh My Zsh ==========
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
ZSH_DISABLE_COMPFIX=true
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
)
source $ZSH/oh-my-zsh.sh
# ========== fzf ==========
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
if command -v fzf &>/dev/null; then
# Use fzf for Ctrl+R history search
eval "$(fzf --zsh 2>/dev/null)" || source <(fzf --generate-shell-integration zsh 2>/dev/null) || true
fi
# ========== History ==========
HISTFILE=~/.zsh_history
HISTSIZE=50000
SAVEHIST=50000
setopt hist_ignore_all_dups
setopt hist_ignore_dups
setopt hist_expire_dups_first
setopt hist_ignore_space
setopt share_history
setopt inc_append_history
# ========== PATH ==========
export PATH="$HOME/dotfiles/bin:$PATH"
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"
export PATH="/opt/homebrew/opt/node@22/bin:$PATH"
# ========== Environment Modules (HPC/Linux servers) ==========
if [ -f /etc/profile.d/modules.sh ]; then
source /etc/profile.d/modules.sh
elif [ -f /usr/share/modules/init/zsh ]; then
source /usr/share/modules/init/zsh
elif [ -f /usr/share/Modules/init/zsh ]; then
source /usr/share/Modules/init/zsh
fi
# ========== Aliases ==========
alias ll='ls -la'
alias la='ls -A'
alias l='ls -CF'
alias gs='git status'
alias sq='squeue'
alias si='sinfo'
alias ta='tmux attach -t'
alias tn='tmux new -s'
# ========== Powerlevel10k ==========
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# ========== Local overrides ==========
# Machine-specific config: conda init, module load, extra aliases, etc.
# This file is NOT managed by dotfiles — your changes persist across updates.
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local