#!/bin/bash # this will allow aliasing any command after sudo alias sudo='sudo ' alias ls='ls --color=auto -F' alias l='ls' alias ll='ls -lh --color=auto -F' alias la='ls -lha --color=auto -F' alias cp='cp -i --reflink=auto' # interactive + auto CoW alias df='df -h' # human-readable sizes du() { /usr/bin/du -h ${@} | sort -h } alias free='free -m' # show sizes in MB if [[ -n "${VIM_TERMINAL}" ]]; then function vim() { if (( ${#@} == 0 )); then echo "Running in Vim's terminal, at least one file must be given!" >&2 return 22 fi for f in "$@"; do if [[ "${f:0:1}" == "-" ]]; then echo "Running in Vim's terminal, not accepting options!" >&2 return 1 fi done for f in "$@"; do # drop the file onto the running vim instance # see :h terminal-communication local abspath=$(realpath $f) echo -e "]51;[\"drop\", \"$abspath\"]" done } fi alias vi=nvim alias svi='sudo -e' #alias vp='vim PKGBUILD' # I have a script for that in ~/bin alias vs='vim SPLITBUILD' alias mutt='neomutt' # colours, I want more colours [[ -x /usr/bin/colordiff ]] && alias diff='colordiff' # colours and case insensitive search export LESS='-RSi' # yes I'm that lazy alias o='rifle' # suspend screensaver when vlc is running alias vlc-suspend='xdg-screensaver suspend $(xprop -name vlc | grep "WM_CLIENT_LEADER(WINDOW)" | sed "s/.*\(0x\d*\)/\1/")' # packaging alias :cp='rm -rf pkg src dbg hdr log logpipe* *.log.* *.log *.pkg.*'