-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
73 lines (60 loc) · 2.15 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
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -e
PATH="/opt/homebrew/opt/openjdk/bin:$PATH" # Java
PATH=${HOME}/.local/bin:$PATH # PIP
PATH=${HOME}/go/bin:$PATH # Go
PATH="/opt/homebrew/opt/ruby/bin:$PATH" # Ruby
PATH=${HOME}/.emacs.d/bin:$PATH # Emacs
PATH=${HOME}/Library/Android/sdk/platform-tools:$PATH # Android
PATH=${HOME}/bin:$PATH # Scripts
PATH=${HOME}/local/bin:$PATH # Small compiled programs
export ANDROID_HOME=${HOME}/Library/Android/sdk/
function code { open -a "Visual Studio Code" $argv }
function fork { open -a "Fork" $argv }
function edge { open -a "Microsoft Edge" $argv }
function safari { open -a "Safari" $argv }
function xc { open -a "Xcode" $argv }
function reload_zsh_config { source ~/.zshrc }
export CODE="${HOME}/Code"
PROMPT="%F{yellow}%T %F{cyan}%~ %F{white}%# "
RPROMPT=""
function list-projects {
find ${CODE} -name .git -maxdepth 3 | sed s/.git$//g
}
function pick-commit {
git log --decorate --pretty="format:%h - %an: %s" --abbrev-commit | fzf --preview 'git show --color=always --stat {1}' | awk '{print $1}'
}
function git-claim-personal {
git config --add --local user.name 'Travis Luckenbaugh'
git config --add --local user.email 'tluckenbaugh@gmail.com'
git config --add --local core.sshCommand 'ssh -i ~/.ssh/id_rsa -o IdentitiesOnly=yes'
}
function git-claim-subaru {
git config --add --local user.name 'Travis Luckenbaugh'
git config --add --local user.email 'tlucke@subaru.com'
git config --add --local core.sshCommand 'ssh -i ~/.ssh/id_ed25519_subaru -o IdentitiesOnly=yes'
}
function pbsort {
pbpaste | sort "$@" | pbcopy
}
# Run HTTP server then open browser
function up {
PORT=$(( $RANDOM % 48576 + 16384 ))
VIEWER=${1?open}
python3 -m http.server ${PORT} &
${VIEWER} "http://localhost:${PORT}/"
fg
}
function xman {
open x-man-page://$1
}
alias ll='exa -l'
alias log='git checkout $(pick-commit)'
alias pcd='cd $(list-projects | fzf)'
alias dictwords='cat /usr/share/dict/words | fzf'
alias wordle='cat ${HOME}/share/wordle | fzf'
alias octordle='cat ${HOME}/share/octordle | fzf'
alias skiping='ping skitheeast.asuscomm.com'
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh