2021-02-13 11:28:59 -05:00
|
|
|
# remap
|
2021-07-12 10:48:30 -04:00
|
|
|
alias x=extract
|
2021-02-13 11:28:59 -05:00
|
|
|
alias p="pulsemixer"
|
|
|
|
alias startx="startx $HOME/.config/X11/xinitrc"
|
|
|
|
alias fehwpp="feh --no-fehbg --bg-fill --randomize ~/Pictures/Wallpapers/*"
|
|
|
|
alias ls="exa -lF --icons --sort=type"
|
|
|
|
alias la="exa -laF --icons --sort=type"
|
|
|
|
alias lt="exa --tree"
|
|
|
|
alias cp="cp -vir"
|
2021-02-20 11:13:12 -05:00
|
|
|
alias mv="mv -vi"
|
2021-02-13 11:28:59 -05:00
|
|
|
alias rm="rm -vr"
|
|
|
|
alias mkdir="mkdir -pv"
|
|
|
|
alias no="grep -viP"
|
|
|
|
alias yarn="yarn --use-yarnrc $HOME/.config/yarn/config"
|
|
|
|
alias tmux="TERM=screen-256color tmux"
|
|
|
|
# colorizing
|
|
|
|
alias grep="grep --color=auto"
|
|
|
|
alias fgrep="fgrep --color=auto"
|
|
|
|
alias egrep="egrep --color=auto"
|
|
|
|
alias diff="diff --color=auto"
|
|
|
|
alias ncdu="ncdu --color=dark"
|
|
|
|
alias ip="ip -color=always"
|
|
|
|
# vim
|
|
|
|
alias v="nvim"
|
2021-03-22 16:13:53 -04:00
|
|
|
alias vi='fzf | xargs -r nvim -o'
|
2021-02-13 11:28:59 -05:00
|
|
|
# emacs
|
2021-05-25 09:39:15 -04:00
|
|
|
alias doom="$HOME/.config/emacs-config/doom/bin/doom"
|
2021-02-13 11:28:59 -05:00
|
|
|
alias e="emacs -nw"
|
2021-02-14 15:59:55 -05:00
|
|
|
alias em="emacsclient -c -a 'emacs'"
|
2021-02-13 11:28:59 -05:00
|
|
|
# rsync
|
2021-05-01 13:03:07 -04:00
|
|
|
alias rsyncdir="rsync -avP --delete-after"
|
2021-02-13 11:28:59 -05:00
|
|
|
# youtube-dl
|
|
|
|
alias yoump3="youtube-dl --extract-audio --audio-format mp3 --embed-thumbnail"
|
|
|
|
alias youflac="youtube-dl --extract-audio --audio-format flac"
|
2021-06-05 15:00:25 -04:00
|
|
|
alias youlist="youtube-dl --yes-playlist"
|
2021-02-13 11:28:59 -05:00
|
|
|
|
|
|
|
# Lazy cd-ing
|
|
|
|
alias ..='cd ..'
|
|
|
|
alias ...='cd ../..'
|
|
|
|
alias ....='cd ../../..'
|
|
|
|
|
|
|
|
# colorize man pages
|
|
|
|
man() {
|
2021-05-06 11:11:51 -04:00
|
|
|
MANPATH=$HOME/.local/share/man:$MANPATH \
|
2021-02-13 11:28:59 -05:00
|
|
|
LESS_TERMCAP_mb=$'\e[01;31m' \
|
|
|
|
LESS_TERMCAP_md=$'\e[01;36m' \
|
|
|
|
LESS_TERMCAP_me=$'\e[0m' \
|
|
|
|
LESS_TERMCAP_se=$'\e[0m' \
|
|
|
|
LESS_TERMCAP_so=$'\e[01;44;33m' \
|
|
|
|
LESS_TERMCAP_ue=$'\e[0m' \
|
|
|
|
LESS_TERMCAP_us=$'\e[01;32m' \
|
|
|
|
command man $@
|
|
|
|
}
|
|
|
|
|
|
|
|
# Search zshall for a special keyword
|
|
|
|
zman() {
|
|
|
|
PAGER="less -g -s '+/^ "$1"'" man ${2:-zshall}
|
|
|
|
}
|
|
|
|
|
|
|
|
# nnn with cd on quit
|
2021-03-08 16:18:17 -05:00
|
|
|
if command -v nnn >/dev/null; then
|
|
|
|
alias ncp="cat ${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} | tr '\0' '\n'"
|
2021-02-13 11:28:59 -05:00
|
|
|
|
2021-03-08 16:18:17 -05:00
|
|
|
n () {
|
|
|
|
# Block nesting of nnn in subshells
|
|
|
|
if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then
|
|
|
|
echo "nnn is already running"
|
|
|
|
return
|
|
|
|
fi
|
2021-02-13 11:28:59 -05:00
|
|
|
|
2021-03-08 16:18:17 -05:00
|
|
|
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
|
|
|
# To cd on quit only on ^G, remove the "export" as in:
|
|
|
|
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
|
|
|
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
|
|
|
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
2021-02-13 11:28:59 -05:00
|
|
|
|
2021-03-08 16:18:17 -05:00
|
|
|
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
|
|
|
|
# stty start undef
|
|
|
|
# stty stop undef
|
|
|
|
# stty lwrap undef
|
|
|
|
# stty lnext undef
|
2021-02-13 11:28:59 -05:00
|
|
|
|
2021-03-08 16:18:17 -05:00
|
|
|
nnn "$@"
|
2021-02-13 11:28:59 -05:00
|
|
|
|
2021-03-08 16:18:17 -05:00
|
|
|
if [ -f "$NNN_TMPFILE" ]; then
|
|
|
|
. "$NNN_TMPFILE"
|
|
|
|
rm -f "$NNN_TMPFILE" > /dev/null
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# nnn in dual pane mode (tmux)
|
|
|
|
n2() {
|
|
|
|
tmux new-session -d -s nnn -n nnn "nnn -Hc"
|
|
|
|
tmux split-window -h "nnn -Hc"
|
|
|
|
TERM=screen-256color tmux attach -t nnn:nnn
|
|
|
|
}
|
|
|
|
fi
|
2021-02-13 11:28:59 -05:00
|
|
|
|
|
|
|
# typing speed testing
|
|
|
|
tt() {
|
|
|
|
iconv -f UTF-8 -t ASCII "$1" | sed 's/--/-/g' \
|
|
|
|
| sed '/^$/d' | sed 's/^[ \t]*//' | sed 's/\(^.\{1,80\}\).*/\1/' \
|
|
|
|
> /tmp/tt.txt
|
|
|
|
command tt /tmp/tt.txt
|
|
|
|
}
|