Refactor aliases

This commit is contained in:
Henrik Lissner 2015-10-28 17:21:19 -04:00
parent 6c7afe6ece
commit db31b2e02a

View file

@ -44,17 +44,12 @@ if is-callable 'transmission-remote'; then
# pretty print torrent list on remote server # pretty print torrent list on remote server
btl() { btl() {
local results local results=`transmission-remote server -l | \
results=`transmission-remote server -l | \
awk 'NR > 1 { s = ""; for (i = 10; i <= NF; i++) s = s $i " "; print $9 " | " s }' | \ awk 'NR > 1 { s = ""; for (i = 10; i <= NF; i++) s = s $i " "; print $9 " | " s }' | \
sed '$d' | \ sed '$d' | \
perl -pe 's/\s\[[a-zA-Z0-9]+\]\s/ /g'` perl -pe 's/\s\[[a-zA-Z0-9]+\]\s/ /g'`
if [ -z "$results" ]; then [ -z "$results" ] && echo "No torrents!" || echo "$results"
echo "No torrents!"
else
echo $results
fi
} }
fi fi
@ -63,11 +58,7 @@ is-callable 'nvim' && alias vim='nvim'
v() { vim ${@:-.}; } # Open in vim v() { vim ${@:-.}; } # Open in vim
e() { emacsclient -n ${@:-.}; } # Open in emacs (daemon) e() { emacsclient -n ${@:-.}; } # Open in emacs (daemon)
ee() { # emacs in project root ee() { # emacs in project root
if git root 2>/dev/null; then git root 2>/dev/null && e "$(git rev-parse --show-toplevel)" || e .
e "$(git rev-parse --show-toplevel)"
else
e .
fi
} }
# Compilers, interpretors 'n builders # Compilers, interpretors 'n builders