-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
106 lines (83 loc) · 3.03 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
# oh my zsh
export ZSH="$HOME/.config/oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(git z fnm node npm yarn brew fd fzf zsh-autosuggestions zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
# Set bat's color theme
# aliases
alias omzr="omz reload"
alias c="clear"
# gmo -> git merge origin
alias gmo='git checkout $(git remote show origin | grep "HEAD branch" | cut -d " " -f5) && git pull && git checkout - && git merge $(git remote show origin | grep "HEAD branch" | cut -d " " -f5)'
# grb -> git checkout recent branch
alias grb='git branch --sort=-committerdate | grep -v "$(git branch --show-current)" | fzf --header "Checkout Recent Branch ( $(git branch --show-current))" --preview "git diff {1} --color=always" --pointer="" | xargs git checkout'
# gcw -> git commit "work in progress"
alias gcw='git commit -m "wip" --no-verify'
# create-melange-app -> create a new melange app
alias create-melange-app='node /Users/dillon/Code/create-melange-app/build/src/app.mjs'
# cma -> create-melange-app
alias cma='create-melange-app'
# code -> open vim
alias code="vim"
# ks -> kill tmux server
alias ks="tmux kill-server"
# functions
# fvim -> find and open a file in vim
function fvim() {
if [[ $# -eq 0 ]]; then
fd -t f | fzf --header "Open File in Vim" --preview "bat --color=always {}" | xargs nvim
else
fd -t f | fzf --header "Open File in Vim" --preview "bat --color=always {}" -q "$@" | xargs nvim
fi
}
# vim -> open vim in the current directory or open the target file
function vim() {
if [[ $# -eq 0 ]]; then
nvim .
else
nvim "$@"
fi
}
function ghp() {
echo "$1" |sed 's/\(github\)/personal.\1/'
}
# fzf
export FZF_DEFAULT_OPTS="--bind ctrl-u:preview-half-page-up,ctrl-d:preview-half-page-down --preview 'bat --color=always{}'"
# git
export GIT_EDITOR=nvim
# sapling
export EDITOR=nvim
# gpg
export GPG_TTY=$(tty)
# starship.rs
export STARSHIP_CONFIG=~/.config/starship/config.toml
export STARSHIP_CACHE=~/.config/starship/cache
eval "$(starship init zsh)"
# fnm
export PATH="/home/$USER/.local/share/fnm:$PATH"
eval "`fnm env`"
# opam configuration
test -r $HOME/.opam/opam-init/init.zsh && . $HOME/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true
# bun completions
[ -s "/Users/dillon/.bun/_bun" ] && source "/Users/dillon/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# ssh-agent# Start the ssh-agent and add all identities
eval "$(ssh-agent -s)" > /dev/null 2>&1
ssh-add --apple-use-keychain ~/.ssh/id_ed25519 > /dev/null 2>&1
ssh-add --apple-use-keychain ~/.ssh/id_ed25519_skolem > /dev/null 2>&1
# direnv hook
eval "$(direnv hook zsh)"
# pnpm
export PNPM_HOME="/Users/dillon/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
# For compilers to find zlib you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/zlib/lib"
export CPPFLAGS="-I/opt/homebrew/opt/zlib/include"
# For pkg-config to find zlib you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/zlib/lib/pkgconfig"