dotfiles-x11/.config/shell/aliasrc

45 lines
1.4 KiB
Bash

#!/bin/sh
# Use neovim for vim if present
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
alias \
ls='ls -hN --group-directories-first --color=auto' \
lsa='ls -lAhN --group-directories-first --color=auto' \
dots='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' \
lf="lfub" \
nb="newsboat" \
sxiv="nsxiv" \
hst="history 1 -1 | cut -c 8- | sort | uniq | fzf | tr -d '\n' | xclip -sel c" \
# Verbosity and settings that you pretty much just always are going to want.
alias \
cp="cp -iv" \
mv="mv -iv" \
rm="rm -vI" \
yt="yt-dlp --embed-metadata -i -o '%(title)s.%(ext)s'" \
yta="yt -x -f bestaudio/best" \
ytbdl="yt-dlp -f bestvideo+bestaudio -o '%(title)s.%(ext)s' --external-downloader=aria2c" \
ytdl="yt-dlp -f best -o '%(title)s.%(ext)s' --external-downloader=aria2c" \
tsm="transmission-remote" \
tsmd="transmission-daemon"
# yt="yt-dlp --embed-metadata -i -o '%(title)s.%(ext)s' --external-downloader=aria2c" \
# Colorize commands when possible.
alias \
grep="grep --color=auto" \
diff="diff --color=auto" \
ip="ip -color=auto"
# git aliases
alias \
ga='git add' \
gc='git commit' \
gp='git push'
ec() {find ~/.config -type f | fzf | xargs -r $EDITOR ;}
es() { cd ~/.local/bin; $EDITOR $(fzf) ;}
ef() {fzf | xargs -r -I % $EDITOR % ;}