-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases
81 lines (55 loc) · 1.21 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
69
70
71
72
73
74
75
76
77
78
79
80
81
shell=`ps | grep $$ | awk '{ print $4 }'`
# BASH
if [[ "$shell" == "bash" ]]
then
# Colorize ls
alias ls='ls --color=auto'
# Easier navigation: .., ..., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias -- -="cd -"
# List only directories
alias lsd='ls -l | grep "^d"'
alias ll='ls -l'
alias la='ls -la'
fi
# ZSH
if [[ "$shell" == "zsh" ]]
then
autoload -U zmv
alias mmv='noglob zmv -W'
fi
# access to dotfiles git
alias dotfiles='GIT_DIR=~/.dotgit git'
# File size
alias fs="stat -f \"%z bytes\""
# ping google
alias pg="ping www.google.com"
# clipboard
alias cb='xclip -selection c'
alias cwd='echo -n `pwd` | cb'
alias t='xdotool sleep 1 type --clearmodifiers'
alias tcb='xdotool sleep 1 type --clearmodifiers "`xclip -o -selection clipboard`"'
# open & find
alias o='gio open'
function f() {
find . -name "$1"
echo -n "Open files? [Y/n]: "
read NO_OPEN
if [[ "$NO_OPEN" != "n" ]]
then
find . -name "$1" -exec xdg-open {} \;
fi
}
if [[ "$shell" == "bash" ]]
then
export -f f
fi
# error handling for the last command
if [ -x "$(command -v thefuck)" ]
then
eval $(thefuck --alias)
fi
alias please='sudo $(fc -ln -1)'
# serving the current directory
alias serve='python -m http.server 8000'