-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_aliases
executable file
·30 lines (27 loc) · 1.1 KB
/
bash_aliases
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
alias ll='ls -lahtr'
alias git=hub
alias vim='nvim'
alias vi='nvim'
alias show_hidden_files='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hide_hidden_files='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
alias code='open -a Visual\ Studio\ Code'
alias atom='open -a Atom'
newpwd() {
len=${1:-12}
LC_ALL=C tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w $len | head -n 1
}
# create a python 3.7 venv as .venv in the current directoy, with the promptname being the current dir's name
venv37() {
[ -z "$VIRTUAL_ENV" ] || deactivate
[ -e .venv ] ||
python3.7 -m venv --prompt "`basename "$PWD"`" .venv
ACTIVATE='.venv/bin/activate'
[ -e "$ACTIVATE" ] && . "$ACTIVATE" && pip install --upgrade setuptools || echo "File not found: $ACTIVATE" >&2
}
venv27() {
[ -z "$VIRTUAL_ENV" ] || deactivate
[ -e .venv ] ||
virtualenv --prompt "(`basename "$PWD"`)" .venv
ACTIVATE='.venv/bin/activate'
[ -e "$ACTIVATE" ] && . "$ACTIVATE" || echo "File not found : $ACTIVATE" >&2
}