-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.zshrc
145 lines (122 loc) · 3.96 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# cd aliases
alias cdarch="cd $PROJECTS_DIR/ArchDesign/ArchDesign"
alias cdblog="cd $BLOG_DIR"
alias cdcss="cd $CSS_DIR"
alias cddart="cd $DART_DIR"
alias cddb="cd $DB_DIR"
alias cddeno="cd $DENO_DIR"
alias cddev="cd $DEV_DIR"
alias cdempowerme="cd $PROJECTS_DIR/EmpowerMe-Apple-Health"
alias cdevergreen="cd $PROJECTS_DIR/evergreen/evergreen-ui"
alias cdflutter="cd $FLUTTER_DIR"
# Goes to root directory of current git repository
# (replaced by cdgitroot function below).
# alias cdgitroot="cd \`git rev-parse --git-dir\`; cd .."
alias cdgo="cd $GO_DIR"
alias cdhtml="cd $HTML_DIR"
alias cdjava="cd $JAVA_DIR"
alias cdjs="cd $JS_DIR"
alias cdlang="cd $LANG_DIR"
alias cdlua="cd $LUA_DIR"
alias cdmongo="cd $MONGO_DIR"
alias cdnode="cd $NODE_DIR"
alias cdnotes="cd ~/MyUnixEnv/notes"
alias cdoci="cd $OCI_DIR"
alias cdpostgres="cd $POSTGRES_DIR"
alias cdprojects="cd $PROJECTS_DIR"
alias cdprolog="cd $PROLOG_DIR"
alias cdpython="cd $PYTHON_DIR":w
alias cdrust="cd $RUST_DIR"
alias cdsqlite="cd $SQLITE_DIR"
alias cdsvelte="cd $SVELTE_DIR"
alias cdswift="cd $SWIFT_DIR"
alias cdtalks="cd $TRAINING_DIR/talks"
alias cdtraining="cd $TRAINING_DIR"
alias cdts="cd $TS_DIR"
alias cdxtrack="cd $XTRACK_DIR"
alias cdyuga="cd $PROJECTS_DIR/YugaLabs"
# Deno aliases
alias dfmt="deno fmt"
alias dlint="deno lint --unstable"
alias drun="deno run"
# Find files aliases
alias findcss='find3 css'
alias findhtml='find3 html'
alias findhtml1='find-depth-1 html'
alias findjava='find3 java'
alias findjs='find3 js*'
alias findjs2='find4 js*'
alias findjson='find3 json'
alias findscss='find3 scss'
alias findsvelte='find3 svelte'
alias findswift='find3 swift'
alias findts='find3 ts*'
# Git aliases
alias add="git add"
alias br="git branch"
alias ci="git commit -av"
alias co="git checkout"
alias cob="git checkout -b"
alias graph="git log --graph --oneline"
alias log="git log"
alias rmb="$HOME/bin/rmb"
alias sha="git rev-parse HEAD"
alias status="git status"
# status report from git commits
alias sr="git log --author="Volkmann" --branches --no-merges --since="8 days ago" --pretty=format:"%cd %s" | tac"
# Ask for confirmation before overwriting or deleting files.
alias cp="cp -i"
alias mv="mv -i"
alias rm="rm -i"
# MySQL aliases
# See MySQLNotes.txt for steps to start mysqld, the daemon.
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
# PostgreSQL aliases
alias pgstart="pg_ctl -D /usr/local/var/postgres start"
alias pgstop="pg_ctl -D /usr/local/var/postgres stop -m fast"
# Prolog aliases
alias ciao="$HOME/.ciaoroot/v1.22.0-m5/build/bin/ciao"
alias scry="$PROLOG_DIR/scryer-prolog/target/release/scryer-prolog"
# Warp aliases
alias cb="clear blocks"
# Other aliases
alias cls="clear"
alias v="nvim"
alias vim="nvim"
# Kill the process listening on a given port.
alias fixsf="fix-swift-format"
alias klp="kill-listening-process"
alias nr="npm run"
alias py="python3"
alias python="python3"
function cdgitroot() {
cd `git rev-parse --git-dir`
cd ..
}
function pull() {
git pull origin $(git rev-parse --abbrev-ref HEAD)
}
function push() {
git push origin $(git rev-parse --abbrev-ref HEAD)
}
function pushn() {
git push --no-verify origin $(git rev-parse --abbrev-ref HEAD)
}
# For Lua
alias love="/Applications/love.app/Contents/MacOS/love"
# Starship prompt
eval "$(starship init zsh)"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# See https://github.com/junegunn/fzf/wiki/examples#changing-directory.
# fd - cd to selected directory
fd() {
local dir
dir=$(find ${1:-.} -path '*/\.*' -prune \
-o -type d -print 2> /dev/null | fzf +m) &&
cd "$dir"
}
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/volkmannm/Documents/dev/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/volkmannm/Documents/dev/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/volkmannm/Documents/dev/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/volkmannm/Documents/dev/google-cloud-sdk/completion.zsh.inc'; fi