-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
85 lines (71 loc) · 2.06 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
75
76
77
78
79
80
81
82
83
84
85
##########
## VARS ##
##########
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# vim lightline support
export TERM=xterm-256color
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
# git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
## PLUGINS ##
plugins=(
zsh-nvm
history-substring-search
wd
git
syntax-highlighting
zsh-autosuggestions
)
source $ZSH/oh-my-zsh.sh
###########
## THEME ##
###########
# requires: npm install pureprompt
ZSH_THEME=""
autoload -U promptinit; promptinit
prompt pure
###########
# TOOLING #
###########
# Advanced file listing, to install
# run: brew install lsd
alias ls='lsd'
# Generic ls alias (installing lsd above will override ls)
alias l='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias lt='ls --tree'
# cat upgrade
# brew install bat
alias cat='bat'
# config autosuggest
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=195'
bindkey '^ ' autosuggest-accept
###############
## FUNCTIONS ##
###############
# Docker-Trash stops, deletes and removes images of all containers matching the pattern passed in the first argument
# arguments
# - container: name of container you want to trash
docker-trash() {
container="$1"
echo "Trashing ${container}"
docker stop $(docker ps -a | grep $container | awk '{ print $1 }');
docker rm $(docker ps -a | grep $container | awk '{ print $1 }');
docker rmi $(docker images -a | grep $container | awk '{ print $3 }');
}
# docker-reset - use instead of 'docker-compose up'. This kills a container if it's running, starts it in the background
# and follows the log file for it
# arguments:
# - container: name of container you want to stop
# - logAmount: how far back to start tail, defaults to 0
docker-reset() {
container="$1"
logAmount=$2 || "0";
echo "Reseting ${container} with tail ${logAmount}"
docker-compose kill $container &&
docker-compose up -d $container &&
docker-compose logs -f --tail=$logAmount $container;
}