-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_aliases
68 lines (55 loc) · 1.72 KB
/
.bash_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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias l.='ls -d .* --color=auto' #shows hidden files
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# cat with syntax highlighting and Git integration
alias cat='bat'
# ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# cd aliases
alias cd..='cd ..'
alias ..='cd ..'
alias ...='cd ../../'
alias .3='cd ../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../../'
# making directories
alias mkdir='mkdir -pv'
function mkcd ()
{
mkdir -p -- "$1" && cd -P -- "$1"
}
# safety: ask before overwriting
alias mv='mv -i'
alias rm='rm -i'
alias cp='cp -i'
# yadm
alias yl='yadm list -a'
alias ys='yadm status'
alias ydiff='yadm diff'
alias ya='yadm add'
alias yc='yadm commit'
alias yph='yadm push'
alias ypl='yadm pull'
# fdfind
alias fd='fdfind'
# disk usage
alias du='du -d 1 -h | sort -h'
# fuzzy finder file preview
alias pf="fzf --preview='bat --color=always --style=numbers {}' --bind shift-up:preview-up,shift-down:preview-down"
alias pt="fzf --preview='less {}' --bind shift-up:preview-up,shift-down:preview-down"
# radian: A 21st-century R console
# note: "R" still opens the traditional R console
alias r="radian"
# fuzzy matching most-visited directories
# https://blog.chaselambda.com/2014/11/07/hella-fast-command-line-navigation.html
alias zc="new_loc=\$(cat ~/.local/share/autojump/autojump.txt | sort -n | grep -Po '^[^\s]+\s+(\K.*)' | fzf +s -e) && cd \"\$new_loc\""