-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
97 lines (75 loc) · 2.63 KB
/
.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
#!/bin/sh
# load private aliases
if [ -f "${HOME}/.aliases_private" ]; then
source "${HOME}/.aliases_private"
fi
alias vim='nvim'
# inspired by <https://www.atlassian.com/git/tutorials/dotfiles>
# gdf stands for "git dotfiles"
alias gdf='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
# prevent typo with `cheat`
alias chat='echo "You mean \"cheat\", right?"'
# allow aliases to be sudoed
alias sudo='sudo '
###############################################################################
# `getclip` - spits the clipboard on stdout
# `setclip < ${file}` - puts file contents in the clipboard
# `command | setclip` - puts command's output in the clipboard
: "${OSTYPE:=$(uname -s)}"
case "$OSTYPE" in
"darwin"*) # MacOS
alias getclip='pbcopy'
alias setclip='pbpaste'
;;
*) # Linux (hopefully)
alias getclip='xclip -selection clipboard -o'
alias setclip='xclip -selection c'
;;
esac
###############################################################################
# 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='grep -E --color=auto'
alias fgrep='grep -F --color=auto'
# Some shortcuts for different directory listings
alias ls='ls -hF --color=tty'
###############################################################################
# misc stuff
###############################################################################
# print each dir in PATH on a separate line
# NOTE: this doesn't work as expected in zsh
# alias path='echo -e "${PATH//:/\\n}" | sort'
# Ruby/exercism.org stuff
###############################################################################
alias irb='irb --simple-prompt'
alias rubyTry='ruby -I../lib -rdisable_skip *_test.rb'
###############################################################################
# eza - successor of exa
alias eza='eza -F'
alias l='eza'
alias ll='eza -l --group-directories-first --sort extension'
alias lla='ll -a'
alias lsd='eza -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'
# GCP stuff
alias gcpProject='gcloud config get-value project'
# use vim with a bare minimum configuration
alias vi='\vim -u ~/.essential.vim'
# always use docker compose plugin instead of standalone docker-compose
alias docker-compose='docker compose'