-
Notifications
You must be signed in to change notification settings - Fork 0
/
.profile
125 lines (102 loc) · 2.76 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
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
#!/bin/sh
alias d=ls
alias ls='ls -G'
alias ll='ls -la'
alias ctop='top -o cpu'
alias mtop='top -o vsize'
alias gti='git'
alias gut='git'
alias gti='git'
alias buuca='brew update && brew upgrade && brew cleanup && brew autoremove'
alias activate='. ./env/bin/activate'
alias reactivate='deactivate && activate'
# common mistypes
alias св=cd
alias мшь=vim
alias vim="vim -O"
alias ыыр="ssh"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# ignore shellcheck not being able to follow non-constant-source
export SHELLCHECK_OPTS="-e SC1090"
PATH=$HOME/bin:$PATH
export PATH
export GOMAXPROCS=8
export CFLAGS="-Wall -g"
# shortcut that removes .pyc files
rmpyc() {
find "${@:-.}" -name '*pyc' -delete
}
export GIT_PS1_DESCRIBE_STYLE="branch"
export GIT_PS1_HIDE_IF_PWD_IGNORED=1
export GIT_PS1_SHOWCOLORHINTS=""
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=''
export GIT_PS1_SHOWUPSTREAM="verbose"
PS1='\[\e[1;34m\]\u \[\e[1;32m\]\W \[\e[1;33m\]$(__git_ps1 "(%s)")\$\[\e[0m\] '
# check if there is a venv and activate it
check_virtualenv() {
env=""
if [ -d .venv ]; then
env=.venv
elif [ -d venv ]; then
env=venv
fi
if [ ! -z "$env" ] && [ -r "$env/bin/activate" ]; then
if [ "$VIRTUAL_ENV" ]; then
deactivate
fi
echo "Activating virtualenv '${env}'"
. $env/bin/activate
fi
}
venv_cd () {
builtin cd "$@" && check_virtualenv
}
# Call check_virtualenv in case opening directly into a directory (e.g
# when opening a new tab in Terminal.app).
check_virtualenv
alias cd="venv_cd"
# git-review helper functions
gitr(){
selecta_args="${2:-}"
if [ "$selecta_args" ]; then
selecta_args="-s $selecta_args"
fi
git review "$1" "$(git review -l | selecta "$selecta_args" | select1)"
}
# gitrd/gitrx
gitrd() {
gitr "-d" "$1"
}
gitrx() {
gitr "-x" "$1"
}
# Platform-specific variables and tokens
if [ -f "$HOME/.tokens" ]; then
. "$HOME/.tokens";
fi
if [ -f "$HOME/.cargo/env" ]; then
source "$HOME/.cargo/env"
fi
# generated with brew shellenv bash
export HOMEBREW_PREFIX="/opt/homebrew"
export HOMEBREW_CELLAR="/opt/homebrew/Cellar"
export HOMEBREW_REPOSITORY="/opt/homebrew"
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}"
export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:"
export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}"
if type brew &>/dev/null
then
if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]
then
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"
else
for COMPLETION in "${HOMEBREW_PREFIX}/etc/bash_completion.d/"*
do
[[ -r "${COMPLETION}" ]] && source "${COMPLETION}"
done
fi
fi
export EDITOR="$HOMEBREW_PREFIX/bin/vim"