-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshalias
97 lines (86 loc) · 3.08 KB
/
.zshalias
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
# vim
alias vi='vim'
alias vimw='viw'
function viw() {
st zsh -c "vim $@; $SHELL" </dev/null &>/dev/null &
disown %%
}
# general
alias ls='LC_COLLATE=C ls --color=always \
--sort=extension \
--indicator-style=slash \
--group-directories-first'
alias lsa='ls -lhA'
alias dup='st &; disown %%'
alias diff='colordiff'
alias less='less -R'
alias grep='grep --color'
alias open='xdg-open'
alias xup='xrdb ~/.Xresources'
alias ocaml='rlwrap ocaml'
alias pyclean='
find . \( \
-name "*.pyc" -type f -o \
-name "__pycache__" -type d \
\) -ls -delete
'
# sudo -- so we can use sudo with aliased commands
alias sudo='sudo '
# dotfiles
alias config='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
# applications
alias chromium='chromium --force-device-scale-factor=1 &>/dev/null &'
alias chrome='chromium'
alias ff='firefox &>/dev/null &'
alias zathura='zathura --fork'
#alias pycharm='wmname LG3D; pycharm'
#alias idea='wmname LG3D; idea.sh'
#alias android-studio='wmname LG3D; android-studio'
alias code='code --force-device-scale-factor=0.5'
alias gitk='gitkraken --force-device-scale-factor=0.5'
# github:
# create a new github repo with the name given as the first argument
# prompts user for password
function githubinit {
curl -u 'rodrigovalle' https://api.github.com/user/repos \
-d "{\"name\": \"$1\"}" -s | \
python -c \
"import sys, json; "`
`"j=json.load(sys.stdin); "`
`"errs=j.get('errors',[]); "`
`"print(*[e['message'] for e in errs],sep='\n'); "`
`"sys.exit(not not errs);"
if [[ -d '.git' && $? -eq 0 ]]; then
printf "Set origin and sync repo in current directory to github [y/n]? "
read -q choice
printf "\n"
case $choice in
y ) git remote remove origin
git remote add origin "https://github.com/rodrigovalle/$1.git"
git remote -v # verify remote URL
git push origin master ;;
n ) return ;;
esac
fi
}
# pacman
alias pac='pacman -S' #install
alias pacu='pacman -Syu' #update
alias pacr='pacman -Rns' #remove
alias pacs='pacman -Ss' #search
alias paci='pacman -Si' #info
alias paclo='pacman -Qdt' #list orphans
alias pacro='paclo && sudo pacman -Rns $(pacman -Qtdq)' #remove orphans
alias pacc='pacman -Scc' #clean cache
alias paclf='pacman -Ql' #list files
# games
alias zork='(cd $HOME/games/zork1; frotz DATA/ZORK1.DAT)'
alias katamari'(cd $HOME/games/katamari; python main.py)'
# shrug
alias shrug='echo "¯\_(ツ)_/¯" | xsel -b'
# pomodoro timer
alias start-timer='(sleep 1500 && notify-send --urgency=critical "break time") &; disown %%'
# copy default file from ~/defaults
function cpdef {
cp "$HOME/defaults/$1" $2
}