summaryrefslogtreecommitdiff
path: root/config/shell/aliasrc
blob: 6f822e98e329f97f731d97d32fd42b81eab85c9a (plain)
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
#!/bin/sh

[ -f "${XINITRC}" ] && alias startx='startx ${XINITRC}'
[ -x "$(command -v vim)" ] && alias vi="vim"
[ -x "$(command -v nvim)" ] && alias vi="nvim"
[ -x "$(command -v neomutt)" ] && alias mutt="neomutt"

# TODO: Deal with the flags that are not supported on BSD
# Older versions of ip doesn't support -color flg, so don't use it
alias \
	clear="clear -x"                                  \
	clip="xclip -selection clipboard"                 \
	diff="diff --color=auto"                          \
	enfr="trans en:fr"                                \
	fren="trans fr:en"                                \
	g="git"                                           \
	grep="grep --color=auto"                          \
	lf="lfcd"                                         \
	ls="ls --color=auto --group-directories-first -p" \
	makeb="make -C ../"                               \
	open="xdg-open"                                   \
	ping="ping -c 2"                                  \
	py="python3"                                      \
	push="git remote show | xargs -I remote git push remote master" # push master branch of all remotes

# Occasionally mistyped commands
alias \
	claer="clear -x" \
	clera="clear -x" \
	gti="git"        \
	maek="make"      \
	meak="make"      \
	suod="sudo"      \
	sl="ls --color=auto --group-directories-first -p"

# Directory change aliases
alias \
	gk="cd /tmp"    \
	gp="cd ~/proj"  \
	gt="cd ~/tproj" \
	gw="cd ~/work"

# Init system aliases
if [ -x "$(command -v systemctl)" ]; then
	alias \
	blue="sudo systemctl start bluetooth"      \
	net="sudo systemctl start NetworkManager"  \
	netstop="systemctl stop NetworkManager"         \
	red="sudo systemctl stop bluetooth"        \
	systemctl="sudo systemctl"
elif [ -x "$(command -v rc-service)" ]; then
	alias \
	blue="sudo rc-service bluetooth start"     \
	net="sudo rc-service NetworkManager start" \
	netstop="sudo rc-service NetworkManager stop"   \
	rc-service="sudo rc-service"               \
	red="sudo rc-service bluetooth stop"
fi

# Arch linux specific aliases
alias \
	pacman="sudo pacman --color=always" \
	arch-wiki="cd /usr/share/doc/arch-wiki/html/en/"