-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases
106 lines (84 loc) · 2.61 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# meleu's bash aliases
######################
# shellcheck disable=1091
# private stuff
if [ -f "${HOME}/.bash_aliases_private" ]; then
source "${HOME}/.bash_aliases_private"
fi
# reload ~/.bashrc
alias bashrc='. ~/.bashrc'
# allow aliases to be sudoed
alias sudo='sudo '
# get/set data from/to X clipboard
###############################################################################
# getclip - spits the clipboard on stdout
alias getclip='xclip -selection clipboard -o'
# setclip ${file} - puts file contents in the clipboard
# command | setclip - puts command's output in the clipboard
alias setclip='xclip -selection c'
###############################################################################
# easier navigation
alias ..='cd ..'
alias ...='cd ../..'
alias -- -='cd -'
# Interactive operation...
alias rm='rm -iv'
alias cp='cp -iv'
alias mv='mv -iv'
# Default to human readable figures
alias df='df -h'
alias du='du -h'
# "disk usage here": disk usage of current directory
alias duh='du -cksh'
alias less='less -r' # raw control characters
alias whence='type -a' # where, of a sort
alias grep='grep --color'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# Some shortcuts for different directory listings
alias ls='ls -hF --color=tty'
###############################################################################
# I'd like to say:
# launch='xdg-open'
# But I'm declaring it as a function in order to assure
# "portability" between Cygwin/macOs/Linux.
launch() {
case "$OSTYPE" in
"cygwin"*)
cygstart "$@"
;;
"darwin"*) # MacOS
open "$@"
;;
*)
xdg-open "$@"
;;
esac
}
# links
alias gmail="launch 'https://gmail.com/'"
alias gist="launch 'https://gist.github.com/'"
# Ruby/exercism.org stuff
###############################################################################
alias irb='irb --simple-prompt'
alias rubyTry='ruby -I../lib -rdisable_skip *_test.rb'
# misc
###############################################################################
alias bat='batcat'
alias vim='nvim'
# exa - https://the.exa.website/
alias l='exa -F'
alias ll='exa --long --group-directories-first'
alias lla='exa -la'
alias lsd='exa -D' # list directories only
# show my IP address that is going to the internet
alias myip='curl -4 icanhazip.com'
alias myip6='curl -6 icanhazip.com'
# print each dir in PATH on a separate line
alias path='echo -e "${PATH//:/\\n}" | sort'
# GCP stuff
alias gcpProject='gcloud config get-value project'
# prevent typo
alias chat='echo "You mean \"cheat\", right?"'
# use vim with a bare minimum configuration
alias vi='\vim -u ~/.essential.vim'