206 lines
4.6 KiB
Bash
206 lines
4.6 KiB
Bash
# vim: ft=zsh
|
|
|
|
|
|
_d() { true ; }
|
|
_f() { true ; }
|
|
_a() { true ; }
|
|
|
|
|
|
alias ls='ls --classify=auto --human-readable'
|
|
alias ll='ls -l'
|
|
alias la='ls --almost-all'
|
|
alias lla='ls -l --almost-all'
|
|
alias l.='ls --almost-all --ignore="*"'
|
|
alias ll.='ls -l --almost-all --ignore="*"'
|
|
|
|
if command -v eza &>/dev/null; then
|
|
alias eza='eza --classify=auto'
|
|
alias ls='eza'
|
|
alias ll='eza --long'
|
|
alias la='eza --all'
|
|
alias lla='eza --long --all'
|
|
alias l.='_d() ( cd "${1:-.}" && eza --list-dirs .* ; ); _d'
|
|
alias ll.='_d() ( cd "${1:-.}" && eza --long --all --list-dirs .* ; ); _d'
|
|
|
|
alias tree='eza --tree'
|
|
fi
|
|
|
|
GREP_OPTIONS=(
|
|
--color=auto
|
|
--binary-files=without-match
|
|
--exclude-dir=.git
|
|
--exclude-dir=.svn
|
|
)
|
|
|
|
alias grep='grep $GREP_OPTIONS'
|
|
alias g='noglob grep $GREP_OPTIONS --dereference-recursive --line-number'
|
|
|
|
alias f='_f() { find . -name "*${1}*" }; noglob _f'
|
|
|
|
alias _='sudo'
|
|
alias root='sudo --login TMOUT=450'
|
|
|
|
alias rm='rm --interactive=once --verbose --recursive --one-file-system'
|
|
alias mkdir='mkdir --parents --verbose'
|
|
alias md='mkdir --parents --verbose'
|
|
|
|
alias q='exit 0'
|
|
|
|
alias path='echo -e ${PATH//:/\\n}'
|
|
|
|
alias dh='dirs -v'
|
|
alias pd='popd'
|
|
|
|
# shorts
|
|
alias c='clear'
|
|
alias h='history -d -D 0'
|
|
alias j='jobs -l'
|
|
|
|
alias zshrc='source "${ZDOTDIR}/.zshrc" >/dev/null'
|
|
|
|
if command -v colordiff &>/dev/null; then
|
|
alias diff='colordiff'
|
|
fi
|
|
|
|
alias tar-it='tar -czf "../${PWD##*/}.tar.gz" .'
|
|
alias man='MANWIDTH=$((COLUMNS > 80 ? 80 : COLUMNS)) man'
|
|
|
|
# time
|
|
alias now='date +"%T"'
|
|
alias nowdate='date +"%d-%m-%Y"'
|
|
alias cal='cal --monday'
|
|
alias beeptime='beep -D 400 -l 400 -r "$(date +%I)" -f 440 -n -D 1000 -l 0 -n -D 800 -l 200 -f 880 -r "$(($(date +%M)/15+1))"'
|
|
|
|
# vim
|
|
alias vi='nvim'
|
|
alias svi="sudo --preserve-env nvim"
|
|
|
|
# git
|
|
for al in s d di co col cob ds u ps pst pl pr hs last lastd df amend br fuck sw swl swc swb
|
|
do
|
|
alias "g${al}"="git ${al}"
|
|
done
|
|
|
|
|
|
# net
|
|
alias ports='ss -tlnp'
|
|
alias wget='wget -c'
|
|
alias ip='ip -c'
|
|
alias fastping='ping -c 100 -i 0.1'
|
|
|
|
alias www='serveit'
|
|
|
|
# hardware
|
|
alias reboot='sudo /sbin/reboot'
|
|
alias poweroff='sudo /sbin/poweroff'
|
|
alias suspend='sudo systemctl suspend'
|
|
alias halt='sudo /sbin/halt'
|
|
alias shutdown='sudo /sbin/shutdown now'
|
|
|
|
alias meminfo='free -mlth'
|
|
|
|
# python
|
|
alias pipir='pip install -r requirements.txt'
|
|
alias pipar='pip list --not-required --format freeze | tee requirements.txt'
|
|
alias vd='deactivate'
|
|
|
|
|
|
# docker
|
|
alias dc='docker compose'
|
|
alias dcl='docker compose logs -f'
|
|
alias drmc='docker container prune'
|
|
alias drmi='docker image prune'
|
|
alias dpsa='docker ps -a'
|
|
|
|
alias gb='gobuild'
|
|
|
|
|
|
# tmux
|
|
alias dt='tmux detach'
|
|
|
|
# x11
|
|
alias caps='xdotool key Caps_Lock'
|
|
alias CAPS='xdotool key Caps_Lock'
|
|
|
|
alias colors='for i in {0..255}; do printf "\x1b[38;5;${i}mcolor${i} - ██████████\n"; done'
|
|
|
|
|
|
alias paste.thek4n.ru='curl --data-binary @- "https://paste.thek4n.ru/" 2>/dev/null'
|
|
alias pastewww='paste.thek4n.ru'
|
|
|
|
alias copy='tee /dev/stderr | \copy'
|
|
|
|
alias ssh='TERM=xterm-256color ssh'
|
|
alias sshn='ssh -S none'
|
|
|
|
alias black='magick canvas:none PNG:- | feh --class black -YFx -'
|
|
alias ex='extract'
|
|
|
|
# Notes
|
|
alias notes='note'
|
|
alias n='note'
|
|
alias ns='note sync'
|
|
alias ne='note edit'
|
|
alias nfe='note fe'
|
|
alias nfg='note fg'
|
|
alias ng='note git'
|
|
alias sn='mdpreview --browser --host localhost --port 0 "$(note --prefix)"'
|
|
|
|
|
|
# Cargo
|
|
alias cr='cargo run'
|
|
alias crr='cargo run --release'
|
|
alias cb='cargo build'
|
|
alias cbr='cargo build --release'
|
|
alias ct='cargo test'
|
|
alias cf='cargo fmt'
|
|
alias cl='cargo clippy --release'
|
|
|
|
|
|
alias p='player'
|
|
|
|
# :)
|
|
alias PINK='beep -f 233 -l 440 -n -f 349 -l 440 -n -f 196 -l 440 -n -f 330 -l 650'
|
|
|
|
alias -g L='2>&1 | $PAGER'
|
|
alias -g H='| head'
|
|
alias -g T='| tail'
|
|
alias -g HL='| highlight -O ansi -S '
|
|
alias -g JSON='| json HL json'
|
|
alias -g DI='| diff'
|
|
alias -g ?='| grep -i'
|
|
alias -g G='| grep -i'
|
|
alias -g C='| wc -l'
|
|
|
|
alias -g CO='--color=always'
|
|
|
|
alias -g ...='../..'
|
|
alias -g ....='../../..'
|
|
alias -g .3='../../..'
|
|
alias -g .....='../../../..'
|
|
alias -g .4='../../../..'
|
|
alias -g ......='../../../../..'
|
|
alias -g .5='../../../../..'
|
|
|
|
alias -g D="DISPLAY=:0.0"
|
|
alias -g XT="TERM=xterm"
|
|
alias -g GP="GOPROXY=direct"
|
|
|
|
alias -g DN=">/dev/null"
|
|
alias -g 2DN="2>/dev/null"
|
|
alias -g ADN="&>/dev/null"
|
|
alias -g BG="&>/dev/null &" # background
|
|
|
|
alias -g RED='2> >(while read line; do printf "\033[0;31m${line}\033[0m\n"; done)'
|
|
|
|
alias -g BEEP='&& beep -f 800 -l 250 -n -f 1000 -l 500 || beep -f 800 -l 250 -n -f 500 -l 500'
|
|
|
|
if [[ "${OSTYPE}" == "linux-android"* ]]; then
|
|
alias -g BEEP='&& termux-notification --sound --vibrate 500,1000,200'
|
|
fi
|
|
|
|
alias -g WAKE='BEEP; notify-send --urgency normal Wake'
|
|
|
|
|
|
alias -g PROXY='http_proxy="socks5://${SOCKS5_SERVER:-localhost}"'
|