-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_aliases
165 lines (124 loc) · 4.36 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# codium is the new atom
alias a="codium ."
# Make ack case-insensitive
# and ignore error messages by default
alias ack="ack -si"
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# List all defined aliases
alias aliases="compgen -a"
# Navigation
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
alias .......="cd ../../../../../.."
alias ........="cd ../../../../../../.."
alias .........="cd ../../../../../../../.."
alias ..........="cd ../../../../../../../../.."
# Command line calculator
# alternatives:
# - bc -l
# - js (node)
alias calc="qalc"
# Open codium with 1 char
alias c="codium ."
# Clear terminal with 2 chars
alias cl="clear"
# Copy/Paste from terminal
alias copy="xclip -selection clipboard"
alias paste="xclip -o -selection clipboard"
# Count characters in a string
alias count="expr length"
# Chrome Stable (clean environment)
alias cs="google-chrome-stable \
--incognito \
--no-default-browser-check \
--no-first-run \
--disable-default-apps \
--disable-search-engine-choice-screen \
--user-data-dir=`mktemp -d`"
# Chrome-dev Test (clean environment)
alias ct="google-chrome-unstable \
--incognito \
--no-default-browser-check \
--no-first-run \
--disable-default-apps \
--disable-search-engine-choice-screen \
--user-data-dir=`mktemp -d`"
# Print directories size
alias dsize="du -sh * | sort -hr"
# Print directories size including dotfiles
alias dsize-all="du -shc .??* * | sort -hr"
# Open explorer with 1 char
alias e="xdg-open ./"
# Open explorer at the current working directory
alias explore="xdg-open ./"
# Print current folder size
alias fat="du -ch | grep total"
#Find files easily
alias ff='sh -c '\''find . -iname *"$1"* | grep --color --ignore-case "$1"'\'' -'
# Firefox Stable (clean environment)
alias fs='firefox-stable -no-remote -profile "`mktemp -d`" -private-window'
# Firefox-nightly Test (clean environment)
alias ft='firefox-nightly -no-remote -profile "`mktemp -d`" -private-window'
# Let fuck-you use 'fuck'
# https://www.npmjs.com/package/fuck-you
# and thefuck use another alias
# https://github.com/nvbn/thefuck
alias fuck="npx fuck"
# Colorize grep output
alias grep="grep --color=auto"
# Google translate in disposable chrome
alias gtr="cs translate.google.fr"
# Print history with 1 char
alias h="history"
# Smaller hamster
alias hamster="hamster-time-tracker"
# HTTP response status codes
# https://www.npmjs.com/package/http-status-identifier-cli
# https://github.com/jaebradley/http-status-identifier-cli
# https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
alias http-code="$HOME/node_modules/.bin/hs"
alias http-response="$HOME/node_modules/.bin/hs"
# MATE lock screen
alias lock="mate-screensaver-command --lock"
# Enhanced file listing
alias ls="ls --color=auto"
alias ll="ls -lAh --time-style long-iso --color=auto"
# Quickly create a meme
alias meme="cs https://imgflip.com/memegenerator"
# Pretty print mounted volumes
alias mounted="mount | grep -E ^/dev | column -t"
# https://zim-wiki.org/
alias notes="zim"
# Add local node modules binaries to $PATH
# NOTE: Keep the single quotes.
alias npm-path='PATH=$(npm bin):$PATH'
# Neovim aliases
# https://www.reddit.com/r/neovim/comments/13s7pvr/comment/jlqs2f7/
# https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME
alias nvchad="NVIM_APPNAME=nvchad nvim"
alias lazyvim="NVIM_APPNAME=lazyvim nvim"
# Echo paths nicely
alias paths="echo $PATH | tr -s ':' '\n'"
# Convert pdf to images to print them easily
alias pdf2image="convert -verbose -density 300 -quality 100 $1 $2"
# print used ports
alias ports="sudo netstat -nltpe"
# Reset terminal with 1 char
alias r="reset"
# Print package.json commands
# https://frontendmasters.com/blog/a-quick-command-to-see-the-available-scripts/
alias scripts="cat package.json | jq --color-output '.scripts'"
# Terminal countdown
# https://github.com/trehn/termdown
alias scrum="termdown 5m"
# Record faster
alias ssr=simplescreenrecorder
# Always color tree output
alias tree="tree -C"
# Update & upgrade packages
alias up="sudo apt-get update && sudo apt-get upgrade"