-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases
56 lines (46 loc) · 1.84 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
# Unix
alias tlf="tail -f"
alias ln='ln -v'
alias mkdir='mkdir -p'
alias ...='../..'
alias l='ls'
alias ll='ls -al'
alias lh='ls -Alh'
alias -g G='| rg'
alias -g M='| less'
alias -g L='| wc -l'
alias -g ONE="| awk '{ print \$1}'"
alias e="$EDITOR"
alias v="$VISUAL"
# Pretty print the path
alias path="echo $PATH | tr -s ':' '\n' | sort"
# Navigation
alias zshconfig="e ~/.zshrc"
alias zshenv="e ~/.zshenv.local"
alias zshlocal="e ~/.zshrc.local"
alias zshsource="source ~/.zshrc"
alias dotfiles='cd ~/dotfiles'
alias dcu="docker-compose up"
alias dcub="docker-compose up --build"
alias dck="docker-compose kill"
alias dcw="docker-compose exec web bash"
alias dcb="docker-compose exec db bash"
alias lg="lazygit"
alias jq="gojq"
alias yless="jless --yaml"
# For git
alias gcob='git checkout $(git branch | fzf)'
alias gcorb='git checkout --track $(git branch -r | fzf)'
alias gbd='git branch -D $(git branch | fzf)'
# Go to the root of a project (git root)
alias root='cd $(git rev-parse --show-toplevel)'
# This kills a process that slows down my Mac every once in a while...??
alias killn="ps -ax | grep notifyd | head -1 | awk '{print \$1}' | sudo xargs kill"
# kill a rogue process running on a specific port
# usage: `killp 3000`
killp() { lsof -n "-i4TCP:${1:-3002}" | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9}
# Utilities for MacOS
alias show-file='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hide-file='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
alias keyboard-disable='sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/'
alias keyboard-enable='sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/'