-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
87 lines (74 loc) · 1.86 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
#!/bin/zsh
# History
HISTFILE=~/.zsh_history
HIST_STAMPS="dd.mm.yyyy"
# Oh-My-Zsh
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
zstyle ':omz:update' mode auto
zstyle ':omz:update' frequency 7
ENABLE_CORRECTION="true"
COMPLETION_WAITING_DOTS="true"
plugins=(git)
# Directories
export REPOS="$HOME/Developer/projects/"
export DOTFILES="$HOME/dotfiles"
export SCRIPTS="$HOME/scripts"
export GITUSER="jmartinn"
export GHREPOS="$REPOS/github.com/$GITUSER"
export SECOND_BRAIN="$HOME/Library/Mobile\ Documents/iCloud\~md\~obsidian/Documents/personal"
# Environment variables
export NVM_DIR="$HOME/.nvm"
export BUN_INSTALL="$HOME/.bun"
export GPG_TTY=$(tty)
export EDITOR='nvim'
# PATH management
typeset -U path
path=(
/opt/homebrew/bin
/opt/homebrew/sbin
$HOME/Library/Python/3.9/bin
/opt/homebrew/opt/libpq/bin
$SCRIPTS
$BUN_INSTALL/bin
$HOME/bin
/usr/local/bin
/opt/homebrew/opt/openjdk@17/bin
$path
)
# Homebrew
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
# Source Oh-My-Zsh
source $ZSH/oh-my-zsh.sh
# Functions
function gclone() {
git clone [email protected]:$GITUSER/$1.git
}
# Aliases
alias zshconfig="nvim ~/.zshrc"
alias ohmyzsh="nvim ~/.oh-my-zsh"
alias cl="clear"
alias sb="cd $SECOND_BRAIN"
alias vim="nvim"
alias repos="cd $REPOS"
alias dots="cd $DOTFILES"
alias ls="eza"
alias ll="eza -alh"
alias tree="eza --tree"
alias cat="bat"
alias npm="pnpm"
# Load NVM
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# Bun completions
[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"
# Performance-intensive operations (consider lazy-loading or caching)
eval "$(fzf --zsh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
# pnpm
export PNPM_HOME="$HOME/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end