-
Notifications
You must be signed in to change notification settings - Fork 5
/
.aliases
50 lines (42 loc) · 1021 Bytes
/
.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# TODO shard this to ~/.aliases.d
# Safer rm/mv/cp by default
alias rm='rm -vi'
alias mv='mv -vi'
alias cp='cp -vi'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -la'
if [ -x "$(command -v nvim 2>/dev/null)" ]; then
alias vi='nvim'
alias vim='nvim'
alias vimdiff='nvim -dO'
alias view='nvim -R'
fi
# More userfriendly output from ls
# shellcheck disable=2010
if ls --version 2>/dev/null | grep -qm1 GNU; then
# TODO dircolors / LS_COLORS
alias ls='ls -Fhb --time-style=long-iso --color=auto'
else
# TODO export CLICOLOR=1 LSCOLORS=XXX
alias ls='ls -Fhb'
fi
# Have chmod print changes
if chmod --version 2>/dev/null | grep -qm1 GNU; then
alias chmod='chmod -c'
else
alias chmod='chmod -v'
fi
# Have chown print changes
if chown --version 2>/dev/null | grep -qm1 GNU; then
alias chown='chown -c'
else
alias chown='chown -v'
fi
# TODO feature detect GNU ps like above
if [ -n "$USE_GNU" ]; then
alias ps="ps --forest -w"
else
alias ps="ps -w"
fi