-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
75 lines (61 loc) · 1.97 KB
/
.zshrc
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
export ZSH=$HOME/.oh-my-zsh
# List all files in colour
export CLICOLOR=1
export LC_ALL=en_US.UTF-8
fpath=($HOME/completion $fpath)
autoload -Uz compinit && compinit -I
ZSH_THEME="oxide"
plugins=(
git
zsh-autosuggestions
history-search-multi-word
)
source $ZSH/oh-my-zsh.sh
#######################
# Aliases / Functions #
#######################
# Shortcuts
alias dv="cd ~/Documents/Development"
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias ls="ls -aGp"
# Restart OS X Finder, Dock or Menubar
alias killFinder="killall Finder"
alias killDock="killall Dock"
alias killMenu="killall SystemUIServer"
# Show/hide hidden files in Finder
alias showFiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hideFiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias hideDesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showDesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# git alias replacement
alias gd="git d"
alias gl="git l"
alias gfu="git fixup"
alias gfr="git frm"
# List tree structure, sorted by directories first
# brew install tree
alias tree="tree --dirsfirst"
# Recursively delete `.DS_Store` files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
# Remove iCloud Drive downloads
alias removeiCloud="find . -type f -exec brctl evict {} \;"
# Justfile in user directory
alias .j="just --justfile ~/Justfile --working-directory ."
# Clean up Docker
docker_cleanup()
{
local exitedContainers=$(docker ps -aq -f status=exited -f status=created -f status=dead)
if [ -n "$exitedContainers" ]; then
docker rm $exitedContainers
else
echo "No exited containers found."
fi
}
# Generate a temporary directory in /tmp
# From `jtm` on Lobsters https://lobste.rs/s/zpw6py/how_do_you_organize_your_home_directory#c_rre2uy
t()
{
cd $(mktemp -d /tmp/$1.XXXX)
}