-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzshrc
More file actions
112 lines (91 loc) · 2.46 KB
/
zshrc
File metadata and controls
112 lines (91 loc) · 2.46 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/zsh
# ============================================================================
# Modern ZSH Configuration
# ============================================================================
# Basic settings
export TERM=xterm-256color
export EDITOR=vim
export VISUAL=vim
# History settings
export HISTSIZE=10000
export SAVEHIST=10000
export HISTFILE=~/.zsh_history
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_SAVE_NO_DUPS
setopt HIST_FIND_NO_DUPS
setopt SHARE_HISTORY
setopt APPEND_HISTORY
# Directory navigation
setopt AUTO_CD
setopt AUTO_PUSHD
setopt PUSHD_IGNORE_DUPS
# Completion
autoload -Uz compinit
compinit
setopt AUTO_MENU
setopt COMPLETE_IN_WORD
setopt ALWAYS_TO_END
# Colors
autoload -U colors && colors
# Adaptive prompt - single line without git, two lines with git
autoload -Uz vcs_info
precmd() {
vcs_info
}
# Basic git support with colors and status indicators
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' unstagedstr '⚡ '
zstyle ':vcs_info:git:*' stagedstr '✚ '
zstyle ':vcs_info:git:*' formats '%F{yellow}%u%c%b%f'
zstyle ':vcs_info:git:*' actionformats '%F{yellow}%u%c%b|%a%f'
setopt PROMPT_SUBST
# Adaptive prompt: single line without git, two lines with git
PROMPT='${vcs_info_msg_0_:+${vcs_info_msg_0_}
}%F{cyan}%n%f %F{red}%~%f %F{red}$%f '
RPROMPT=''
# PATH configuration
# Add Volta to PATH for workos
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
# Add Homebrew to PATH
eval "$(/opt/homebrew/bin/brew shellenv)"
# Node version manager
if command -v nodenv >/dev/null 2>&1; then
eval "$(nodenv init -)"
fi
# Ruby version manager
if command -v rbenv >/dev/null 2>&1; then
eval "$(rbenv init -)"
fi
# Aliases
alias ll='ls -la'
alias la='ls -a'
alias l='ls -l'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
# Git aliases
alias g='git'
alias gs='git status'
alias ga='git add'
alias gc='git commit'
alias gp='git push'
alias gl='git pull'
alias gco='git checkout'
alias gb='git branch'
alias gd='git diff'
# Development aliases
alias py='python3'
alias serve='python3 -m http.server'
alias ports='lsof -i -P | grep LISTEN'
# System aliases
alias path='echo $PATH | tr ":" "\n"'
alias ip='ipconfig getifaddr en0'
alias flush='sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder'
alias cleanup='find . -type f -name "*.DS_Store" -delete'
# Load local configuration if it exists
if [[ -f ~/.localrc ]]; then
source ~/.localrc
fi