]> git.rmz.io Git - dotfiles.git/blob - aliases
nvim: replace telescope with snacks.picker
[dotfiles.git] / aliases
1 #!/bin/bash
2 # this will allow aliasing any command after sudo
3 alias sudo='sudo '
4
5 alias ls='ls --color=auto -F'
6 alias l='ls'
7 alias ll='ls -lh --color=auto -F'
8 alias la='ls -lha --color=auto -F'
9
10 alias cp='cp -i --reflink=auto' # interactive + auto CoW
11 alias df='df -h' # human-readable sizes
12 du() { /usr/bin/du -h ${@} | sort -h }
13 alias free='free -m' # show sizes in MB
14
15 if [[ -n "${VIM_TERMINAL}" ]]; then
16 function vim() {
17 if (( ${#@} == 0 )); then
18 echo "Running in Vim's terminal, at least one file must be given!" >&2
19 return 22
20 fi
21 for f in "$@"; do
22 if [[ "${f:0:1}" == "-" ]]; then
23 echo "Running in Vim's terminal, not accepting options!" >&2
24 return 1
25 fi
26 done
27 for f in "$@"; do
28 # drop the file onto the running vim instance
29 # see :h terminal-communication
30 local abspath=$(realpath $f)
31 echo -e "\e]51;[\"drop\", \"$abspath\"]\a"
32 done
33 }
34 fi
35 alias vi=nvim
36 alias svi='sudo -e'
37 #alias vp='vim PKGBUILD' # I have a script for that in ~/bin
38 alias vs='vim SPLITBUILD'
39
40 alias mutt='neomutt'
41
42 # colours, I want more colours
43 [[ -x /usr/bin/colordiff ]] && alias diff='colordiff'
44
45 # colours and case insensitive search
46 export LESS='-RSi'
47
48 # yes I'm that lazy
49 alias o='rifle'
50
51 # suspend screensaver when vlc is running
52 alias vlc-suspend='xdg-screensaver suspend $(xprop -name vlc | grep "WM_CLIENT_LEADER(WINDOW)" | sed "s/.*\(0x\d*\)/\1/")'
53
54 # packaging
55 alias :cp='rm -rf pkg src dbg hdr log logpipe* *.log.* *.log *.pkg.*'