-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.madelainerc-local
138 lines (111 loc) · 4.26 KB
/
.madelainerc-local
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
export SHELL=zsh;
#hg aliases
alias hw='hg log --numstat';
alias brh='hg bookmarks';
alias hst='hg status';
alias hupdate='hg commit -A --amend --reuse-message .';
#git
alias g='git';
alias gw='git log --numstat';
# git compatibility w/ main and master
alias gcom='git checkout main 2> /dev/null || git checkout master'
gbmaster () {
[ $(git rev-parse --verify main 2> /dev/null) ] && echo main || echo master
}
alias br='git branch';
alias st='git status';
alias cont='git rebase --continue; git cherry-pick --continue;'
alias gupdate='git commit -a --amend --reuse-message=HEAD'
alias amend='git commit -a --amend --reuse-message=HEAD'
alias up='git fetch; git rebase origin/master';
alias reb='git rebase -i';
alias rb='git rebase';
alias change='git log --reverse origin/stable..';
function mup () {
branchname="$(git symbolic-ref --short HEAD)"
main_branch="$(gbmaster)"
git checkout $main_branch && git fetch -p origin && git reset --hard "origin/$main_branch"
git checkout "$branchname"
}
alias co='git checkout';
alias glog="git log --graph --pretty=format:'%Cred%h%Creset %C(cyan)%an%Creset %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative";
function gb () {
git branch $1 && git checkout $1
}
function branchclean() {
git fetch --prune; git branch -vv | grep ': gone]' | grep -v "\*" | awk '{ print $1; }' | xargs git branch -D;
}
# tmux
alias tsb='tmux show-buffer'
alias tcp='tmux show-buffer | pbcopy'
function notify {
if $@
then
say -v Kyoko "Completed $1"
else
say -v Kyoko "Error encountered for $1"
fi
}
export EDITOR=vim
alias hack=vim
alias killadobe='sudo cp /dev/null /private/var/root/Library/Logs/PDApp.log'
export NVM_DIR="/Users/madelaine/.nvm"
# creeped from @compnerd's dotfiles:
# https://github.com/compnerd/dotfiles/blob/master/zshrc
# alias ping='ping -c4'
#
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
alias killqld='find /private/var/folders/ -name com.apple.QuickLook.thumbnailcache | sudo xargs rm -rf && /usr/bin/killall -9 quicklookd'
alias killcisco="kill -9 $(pgrep -i cisco)"
export DOCKER_ID_USER="intellectuallyswole"
alias killaudio="ps aux | grep 'coreaudio[d]' | awk '{print $2}' | xargs sudo kill"
alias py3='python3'
alias py='python3'
export PATH="$PATH:/Applications/Postgres.app//Contents/Versions/11/bin/"
function badtouch {
pkill "Touch Bar agent";
killall ControlStrip;
}
# Docker
function docker-pg {
docker pull postgres
mkdir -p $HOME/docker/volumes/postgres
docker run --rm --name pg-docker -e POSTGRES_PASSWORD=docker -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres
echo "Password is docker\n"
sleep 5
psql -h localhost -U postgres -d postgres
}
function dockerprune {
docker rm $(docker ps -q -f 'status=exited')
docker rmi $(docker images -q -f "dangling=true")
}
# Golang
export PATH="$PATH:/usr/local/go/bin"
# History changes!
# https://blog.sanctum.geek.nz/better-bash-history/
# https://jdhao.github.io/2021/03/24/zsh_history_setup/
export HISTFILE=~/.zsh_history
# the detailed meaning of the below three variable can be found in `man zshparam`.
# Append to history file after each command (can be shared across sessions).
setopt INC_APPEND_HISTORY_TIME
export HISTSIZE=1000000
export HISTFILESIZE=1000000000 # not sure if this is zsh?
export SAVEHIST=1000000
# The meaning of these options can be found in man page of `zshoptions`.
setopt HIST_IGNORE_ALL_DUPS # do not put duplicated command into history list
setopt HIST_SAVE_NO_DUPS # do not save duplicated command
setopt HIST_REDUCE_BLANKS # remove unnecessary blanks
setopt INC_APPEND_HISTORY_TIME # append command to history file immediately after execution
setopt EXTENDED_HISTORY # record command start time
export HISTTIMEFORMAT="[%F %T] "
# History substring search.
# Will fail if you don't first `brew install zsh-history-substring-search`
source /opt/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh
# bind up and down keys
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# more config: https://github.com/zsh-users/zsh-history-substring-search#configuration
# Tab completion (ZSH-specific)
autoload -Uz compinit
# -i to ignore potentially insecure directories (run `compaudit` to see which ones)
compinit -i