aboutsummaryrefslogtreecommitdiff
path: root/.zsh_aliases
blob: 5627844b5109f0d560aa4fdade80f0ce8c68e603 (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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
###############
# zsh aliases #
###############

# color
alias grep='grep --color=auto'
alias tree='tree -C'
alias pacman='pacman --color=auto'
alias valgrindc='colour-valgrind'

# common commands
alias less='less -N'   # enable line number
alias v='vim'
# alias vim='nvim'
# alias mkdir='mkdir -p'
alias gdb='gdb -q'     # disable long intro message
alias sudo='sudo '     # enable color (the search for aliases continues)
alias doas='doas '     # same for doas
alias info='info --vi-keys'

# ls
alias ls='ls --color=auto -F'
alias ll="ls -lh"
alias la="ls -a"
alias lla="ls -alh"
alias lss="ls -Ssh"

# tree
alias tree='tree -FC'
alias t='tree'
alias ta='tree -a'
alias t1='tree -L 1'
alias t2='tree -L 2'
alias t3='tree -L 3'
# alias ti="tree | grep -v -E '*.pyc'"

# man
alias ma="man"
alias ma1="man 1"
alias ma2="man 2"
alias ma3="man 3"

# make
alias m='make'
alias mre='make re'
alias mclean='make clean'

# git
alias ga='git add'
alias gaa='git add --all'
alias gau='git add --update'
alias gc='git commit'
alias gc!='git commit --amend'
alias gcmsg='git commit --message'
alias gd='git diff'
alias gds='git diff --staged'
alias gdt='git diff --stat'
alias gl='git pull'
alias glg='git log --abbrev-commit --stat'
alias glgg='git log --abbrev-commit --graph'
alias glgo='git log --oneline --no-decorate'
alias gp='git push'
alias gcl='git clone --recurse-submodules'
alias gst='git status'
alias gs='git status'
alias gss='git status --short'
alias gco='git checkout'
alias gsta='git stash push'
alias gstp='git stash pop'
alias grv="git remote -v"
alias gra="git remote add"
gpa() {
    branch="$1"
    [ -z "$1" ] && branch=master
    git remote | xargs -I{} git push {} "$branch"
}

# lpass (lastpass-cli)
alias lpassp='lpass show --password --clip'  # put password in clipboard

# helper to switch between dual and single monitor setup
alias dual='xrandr --output LVDS1 --primary --left-of VGA1 --output VGA1 --auto'
alias single='xrandr --output VGA1 --off'

# edit config files
alias zshrc="vim $DOTDIR/.zshrc && source $DOTDIR/.zshrc"
alias zshaliasrc="vim $DOTDIR/.zsh_aliases && source $DOTDIR/.zshrc"
alias vimrc="vim $DOTDIR/.vimrc"
alias vimplugrc="vim $DOTDIR/.pluggins.vim"
alias xmonadrc="vim $DOTDIR/xmonad.hs"
alias muttrc="vim $DOTDIR/.muttrc"

# other
#alias date="date -R"

# parent directory jump
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

alias norm='ruby -I/home/charles/git/norminette/vendor/bundle/ruby/2.7.0/gems/parseconfig-1.0.8/lib/ ~/git/norminette/norminette.rb'

getrfc() {
    curl "https://ietf.org/rfc/rfc$1.txt" > "$HOME/rfc/rfc$1.txt"
}

# bluetooth
alias bt='bluetoothctl'
alias bton='echo power on | bluetoothctl'
alias btoff='echo power off | bluetoothctl'

# pdf selector
alias openpdf='zathura `ls -1 *.pdf | dmenu` &'

alias cagob='RUSTFLAGS="$RUSTFLAGS -A dead_code" cargo build'
alias cagor='RUSTFLAGS="$RUSTFLAGS -A dead_code" cargo run'

# wifi
wificonnect() {
    nmcli device wifi connect $1 password $2
}

# alias mutt='neomutt'

alias ytdl='youtube-dl --output "%(title)s.%(ext)s"'
alias ytdlp='youtube-dl -i --output "%(playlist_index)s-%(title)s.%(ext)s"'
alias ytdla='youtube-dl -i -x -f bestaudio/best --output "%(playlist_index)s-%(title)s.%(ext)s"'

alias qmvdest='qmv --format=do'

alias xclip='xclip -selection clipboard'

pacman-url() {
    pacman -Si "$1" | grep URL | tr -s ' ' | cut -d ' ' -f 3
}

grep-kill() {
    ps aux | grep "$1" | tr -s ' ' | cut -d ' ' -f 2 | xargs kill
}