-
Notifications
You must be signed in to change notification settings - Fork 1
/
.profile
88 lines (69 loc) · 2.79 KB
/
.profile
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
export HOMEBREW_INSTALL_BADGE="🔫 💪"
export FZF_DEFAULT_COMMAND='
(fd ||
find * -name ".*" -prune -o -type f -print -o -type l -print) 2> /dev/null'
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
--color=dark
--color fg:-1,bg:-1,hl:39,fg+:3,bg+:234,hl+:229
--color info:150,prompt:110,spinner:150,pointer:167,marker:174
'
export HISTCONTROL=ignoreboth:erasedups
# moar colors
alias grep="grep --color"
alias ls="ls -G"
export LSCOLORS=dxfxcxdxbxegedabagacad
export ACK_COLOR_MATCH='red'
export EDITOR='nvim'
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/sbin:~/bin:$PATH
export DIRENV_LOG_FORMAT=''
export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc
xzarchive() {
archive_target=${1%/}
if [ -d "$archive_target/log/" ]; then
:> "$archive_target/log/*.log"
fi
if [ -d "$archive_target/tmp/cache" ]; then
rm -rf "$archive_target/tmp/cache"
fi
if [ -d "$archive_target/node_modules" ]; then
rm -rf "$archive_target/node_modules"
fi
if [ -d "$archive_target/public/uploads" ]; then
rm -rf "$archive_target/public/uploads"
fi
if [ -d "$archive_target/public/system" ]; then
rm -rf "$archive_target/public/system"
fi
tar -c "$archive_target" | xz -3 --lzma2=preset=3,dict=512Mi --verbose > "$archive_target.tar.xz"
}
tmsetup() {
sudo tmutil addexclusion -p ~/Downloads
sudo tmutil addexclusion -p ~/.rbenv
sudo tmutil addexclusion -p ~/.npm
# Exclude logs
fd --no-ignore-vcs --exclude node_modules --exclude public/system --exclude public/uploads --exclude tmp -p -g "**/log/*.log" ~/Projects -x sudo tmutil addexclusion -p
# Exclude tmp directories of Rails projects
fd --no-ignore-vcs --exclude public/system --exclude public/uploads -p -g "**/*/tmp" ~/Projects -x sudo tmutil addexclusion -p
}
dbdump() {
mkdir -p ~/.dbbackups
mongodump --archive --quiet | zstd -17 -T4 | tee ~/.dbbackups/mongo-$(date -u +%Y-W%W).zst ~/.dbbackups/mongo-$(date -u +%w).zst > /dev/null
pg_dumpall | zstd -17 -T4 | tee ~/.dbbackups/postgres-$(date -u +%Y-W%W).zst ~/.dbbackups/postgres-$(date -u +%w).zst > /dev/null
}
if which rbenv > /dev/null; then eval "$(rbenv init - --no-rehash)"; fi
alias cici='goreman -f Procfile.test start'
alias dot='(cd && nvim $(git ls-files | fzf))'
alias gg=lazygit
export LESS=-R
export LESS_TERMCAP_mb="$(printf '%b' '[1;31m')"
export LESS_TERMCAP_md="$(printf '%b' '[1;36m')"
export LESS_TERMCAP_me="$(printf '%b' '[0m')"
export LESS_TERMCAP_so="$(printf '%b' '[01;44;33m')"
export LESS_TERMCAP_se="$(printf '%b' '[0m')"
export LESS_TERMCAP_us="$(printf '%b' '[1;32m')"
export LESS_TERMCAP_ue="$(printf '%b' '[0m')"
export HOMEBREW_NO_AUTO_UPDATE=1
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm