~tardypad/dotfiles

ref: 6c6da645bdf106f6cb251579c4eb42cbb0a19e8d dotfiles/files/configs/zsh/config.d/aliases.zsh -rw-r--r-- 3.2 KiB
6c6da645 — Damien Tardy-Panis Remove unused _operands function in _time-tracker completion 2 months ago
                                                                                
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
# ring bell
alias bell="printf '\a'"

# Prompt before overwrite/removal
alias mv='mv -i'
alias cp='cp -i'
alias rm='rm -i'

# colorize outputs
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias diff='diff --color=auto --palette="rs=0:hd=1:ad={color/add/fg}:de={color/delete/fg}:ln={color/base0B/fg}"'

# ls alias
alias lh='ls -lh'

# quick jump to often used folders
alias dc='cd "${XDG_DOCUMENTS_DIR:-$HOME/Documents}"'
alias dk='cd "${XDG_DESKTOP_DIR:-$HOME/Desktop}"'
alias dw='cd "${XDG_DOWNLOAD_DIR:-$HOME/Downloads}"'
alias nt='cd "${XDG_NOTES_DIR:-$HOME/Notes}"'

# bluetooth connections
alias btc='bluetoothctl connect'
alias btd='bluetoothctl disconnect'

# source directory aliases
alias .a='cat .aliases 2> /dev/null && . ./.aliases'

alias todo='${EDITOR} "${XDG_NOTES_DIR:-$HOME/Notes}/todo.md"'

alias g='git'

alias st='ssh-tags'
alias qht='query-hosts-tags'

alias pj='goto-project repo'
alias PJ='goto-project main'

alias max='calculate maximum'
alias min='calculate minimum'
alias mean='calculate mean'
alias sum='calculate sum'

alias b102='base 10 2'
alias b210='base 2 10'
alias b1016='base 10 16'
alias b1610='base 16 10'
alias b162='base 16 2'
alias b216='base 2 16'

alias rn='read-news'
alias tk='task'
alias tkl='task-log'
alias tt='time-tracker'
alias tto='time-tracker-overview'
alias tts='time-tracker-sum'
alias dnd='do-not-disturb'
alias pmd='pomodoro'
alias lbl='line-by-line'
alias mnt='mount-device'

# smart cut on spaces
alias scut="tr -s ' ' '\t' | cut"

# DOS to Unix newlines
alias dos2unix="tr -d '\r'"

# Remove accents
alias unaccent="iconv -f UTF-8 -t ASCII//TRANSLIT"

# trim spaces
alias trim="sed -e 's/^ *//' -e 's/ *$//'"

# remove color sequences
alias nocolor="sed 's/\x1b\[[0-9;]*m//g'"

# clean the tmux pane before running a command
alias clean='clear && tmux clear-history &&'

# display calendar for full year with week number and Monday as week start
alias calendar='cal --monday --week --year'

# disable status output on completion of some commands
alias mpc='mpc -q'

# reverse fzf when used in a terminal
# not included in FZF_DEFAULT_OPTS
# because we don't want this when used within vim
# (and there is no --noreverse option currently to overwrite it there)
alias fzf='fzf --reverse'

# most remote hosts don't have the tmux terminfo we use within tmux
alias ssh='TERM=xterm-256color ssh'

# switch to root
alias root='sudo -sE'

# reload shell
alias reload='source "${HOME}/.zshrc"'

# generate a password (mainly used to encrypt files to share)
alias passwdgen='echo $( < /dev/urandom tr -d -C "[:graph:]" | dd bs=1 count=30 2> /dev/null )'

# retrieve my public IP
alias myip='curl -s https://api.ipify.org && printf "\n"'

# simple linters
alias json-lint='jq'
alias xml-lint='xmllint --format -'

# allow usage of * in queries without need for escaping
alias mysql-env='noglob mysql-env'
alias redis-env='noglob redis-env'
alias influx-env='noglob influx-env'
alias qalc='noglob qalc'

# flush all .log files recursively in the current dir
alias flush-logs="find . -type f -name '*.log' -exec /bin/sh -c \"printf '' > '{}'\" \;"

# tests
alias test-micro='arecord -f cd -d 3 /tmp/test-micro.wav && aplay /tmp/test-micro.wav && rm -f /tmp/test-micro.wav'
alias test-webcam='mpv av://v4l2:/dev/video0'