-
Notifications
You must be signed in to change notification settings - Fork 2
/
zshenv
168 lines (147 loc) · 5.02 KB
/
zshenv
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# env variables
export CCACHE_BASEDIR=/home/twilco/projects
export CHANGE_LOG_NAME="Tyler Wilcock"
export EDITOR=nvim
export EMAIL_ADDRESS="[email protected]"
export RISCV_OPENOCD_PATH="$HOME/usys/riscv/riscv-openocd-0.10.0-2019.02.0-x86_64-apple-darwin"
export RISCV_PATH="$HOME/usys/riscv/riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-apple-darwin"
# random
# --------------------------------
alias mdkir='mkdir'
alias sg='sr google'
alias reloadshell='exec $SHELL -l'
alias cl='clear'
# fzf
# --------------------------------
alias vf='v -o $(fzf --height=70% --preview="bat {}" --preview-window=right:60%:wrap)'
# export fzf_preview_pane_opts='--height=70% --preview="bat {}" --preview-window=right:60%:wrap'
export FZF_DEFAULT_COMMAND='rg --files --follow'
export FZF_CTRL_T_COMMAND='$FZF_DEFAULT_COMMAND'
# riscv
# --------------------------------
alias rvgcc='~/usys/riscv/riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-apple-darwin/bin/riscv64-unknown-elf-gcc'
alias rvas='~/usys/riscv/riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-apple-darwin/bin/riscv64-unknown-elf-as'
alias rvgdb='~/usys/riscv/riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-apple-darwin/bin/riscv64-unknown-elf-gdb'
alias rvld='~/usys/riscv/riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-apple-darwin/bin/riscv64-unknown-elf-ld'
alias rvqemu='qemu-system-riscv64'
alias rvnm='~/usys/riscv/riscv64-unknown-elf-gcc-8.2.0-2019.02.0-x86_64-apple-darwin/bin/riscv64-unknown-elf-nm'
# ls
# --------------------------------
### Colorize the ls output
alias ls='ls -G --color'
### Use a long listing format
alias ll='ls -la'
### Show hidden files
alias l.='ls -Gd .*'
# cd
# --------------------------------
### back 1 directory
alias ..='cd ..'
alias .1='cd ..'
### cd back 2 directories
alias .2='cd ../../'
alias ...='cd ../../'
### back 3 directories
alias .3='cd ../../../'
alias ....='cd ../../../'
### back 4 directories
alias .....='cd ../../../../'
alias .4='cd ../../../../'
# git
# --------------------------------
# Most of these can probably be moved to the more standard ~/.gitconfig file.
alias gap='git add -p'
alias gcoh='git checkout HEAD'
alias gds='git diff --staged'
alias gmff='git merge'
alias gm='git merge --no-ff'
# Git show current branch
alias gscb='git branch --show-current'
alias grma='git rebase $(git_main_branch)'
alias gb='git go'
# Pushes branch upstream and then opens PR in browser.
if [ "$(uname 2> /dev/null)" != "Linux" ]; then
alias gprsup='open $(git push --set-upstream origin $(git branch --show-current) 2>&1 | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*")'
else
alias gprsup='firefox $(git push --set-upstream origin $(git branch --show-current) 2>&1 | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*")'
fi
alias gslp='git stash && git pull && git stash pop'
alias grbc='git rebase --continue'
alias grbi='interactive_rebase_from_head'
function interactive_rebase_from_head() {
git rebase -i HEAD~$1
}
# docker
# --------------------------------
alias dc='docker-compose'
alias dcb='docker-compose build'
alias dcd='docker-compose down'
alias dcu='docker-compose up'
alias dcud='docker-compose up -d'
alias dcp='docker-compose pull'
alias dcrs='dcb && dcu'
alias dsta='docker stop $(docker ps -a -q)'
alias dps='docker ps'
alias dlo='docker logs'
alias dsh='dockersh'
function dockersh() {
docker exec -it $1 /bin/bash
}
# gradle
# --------------------------------
alias gir='./gradlew idea --refresh-dependencies'
alias gi='./gradlew idea'
# lldb
# --------------------------------
alias patp='lldb process attach -p'
alias patn='lldb process attach -n'
# rust
#---------------------------------
alias cb='cargo build'
alias cck='cargo check'
alias cdo='cargo doc --open'
alias cfmt='cargo fmt'
alias cfb='cargo fmt && cargo build'
alias cfc='cargo fmt && cargo check'
alias cr='cargo run'
alias ct='cargo test'
alias twas='cargo test --target wasm32-unknown-unknown'
. "$HOME/.cargo/env"
# tmux
#---------------------------------
alias ta='tmux a'
alias tat='tmux a -t'
alias tn='tmux new'
alias tls='tmux ls'
alias tk='tmux kill-session -t'
alias tkall='tmux kill-server'
# vim/neovim
#---------------------------------
alias v='vim'
# webkit
#---------------------------------
alias trw='trap-webprocess'
alias md="make debug"
alias mr="make release"
alias rwkt="run-webkit-tests --no-build --no-retry --no-show-results --time-out-ms=6000"
alias rwkta="run-webkit-tests --no-build --no-retry --no-show-results --time-out-ms=6000 --accessibility-isolated-tree"
function run-all-webkit-test-configurations {
echo "---------------- WebKit2 NO ISOLATED TREE ----------------"
sleep 2
rwkt $*
echo "---------------- WebKit2 WITH ISOLATED TREE ----------------"
sleep 2
rwkta $*
echo "---------------- WebKit1 NO ISOLATED TREE ----------------"
sleep 2
rwkt -1 $*
}
alias rwktall="run-all-webkit-test-configurations"
alias rcl="Tools/Scripts/resolve-ChangeLogs"
alias wkp="Tools/Scripts/webkit-patch"
# Generally useful functions
#---------------------------------
# Create a new directory and enter it
function mkd() {
mkdir -p "$@" && cd "$_";
}