-
Notifications
You must be signed in to change notification settings - Fork 6
/
zshrc
147 lines (119 loc) · 3.56 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
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
function source_if_exists() {
local file_path="$1"
if [ -f "$file_path" ]; then
. "$file_path"
fi
}
function source_if_exists_many() {
for file in "$@"; do
source_if_exists "${file}"
done
}
function add_to_path_if_exists() {
local dir_path="$1"
if [ -d "$dir_path" ] && [[ ":$PATH:" != *":$dir_path:"* ]]; then
export PATH="$dir_path:$PATH"
fi
}
# Array of file paths
files=(
"~/.zprezto/init.zsh"
"$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc"
"$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc"
'~/git/google-cloud-sdk/path.zsh.inc'
'~/git/google-cloud-sdk/completion.zsh.inc'
"$(brew --prefix)/etc/profile.d/z.sh"
)
env_file="$HOME/.env.secret.zsh"
if [ -f "$env_file" ]; then
source "$env_file"
fi
source_if_exists_many "${files[@]}"
# Import all custom plugins and love
for f in ~/.zsh/*
do source $f
done
export THEME_COLORS=gruvbox-dark
# Zsh Files of Miguel Palau
export PATH="/usr/local/sbin:$PATH"
export PATH="$HOME/.bin:$PATH"
# Homebrew cask
export HOMEBREW_CASK_OPTS="--appdir=~/Applications --caskroom=/etc/Caskroom"
export HOMEBREW_NO_ENV_HINTS=true
if type nvim > /dev/null 2>&1; then
alias vim='nvim'
fi
alias v='nvim'
alias dc='docker-compose'
alias x='exit'
alias df='cd ~/dotfiles'
alias gf='cd ~/git'
export TERM=xterm-256color
export EDITOR='nvim'
# Set personal aliases, overriding those provided by oh-my-zsh libs,
alias rst='exec zsh'
# Run local npm packages
alias npmL='PATH="$(npm bin)":"$PATH"'
# Install Quickly with --save-dev
alias npmD="npm i -D "
# Install Quickly with --save
alias npmS="npm i -S "
# Open apps quickly from the terminal
alias oa="open -a "
# Yarn Baby!
alias yS='yarn add '
alias yD='yarn add --dev '
# Quick git status
alias g='git '
alias gs='git status'
alias gaa='git add .'
alias gc='git commit'
alias gP='git push'
alias gp='git pull'
alias gr='git rebase'
alias gd='git diff'
alias gxo='git checkout'
alias gb='git branch'
alias gbd='git branch -d'
alias gl='git lg'
alias k='kubectl'
# Quick clear
alias c='clear'
alias ll='eza -lah'
alias x='exit'
# Movement
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
alias rm="trash"
alias nuke_modules="find . -name 'node_modules' -type d -prune -print -exec trash '{}' \;"
# Fuck autocorrect in zsh...
unsetopt correct
setopt rm_star_silent
# Highlight stuff with less
LESSPIPE=`which src-hilite-lesspipe.sh`
export LESSOPEN="| ${LESSPIPE} %s"
export LESS=' -R -X -F '
# Show or hide all files on the finder
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
# fzf completions
source <(fzf --zsh)
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
export GPG_TTY=$(tty)
# Starship prompt
eval "$(starship init zsh)"
# allow locally installed npm binaries to be executed;
# added by `npm i -g add-local-binaries-to-path`
export PATH="$PATH:./node_modules/.bin"
export PATH="$HOME/go/bin:$PATH"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
export PATH="$PATH:$HOME/git/deployment_tools/scripts/gcom"
# Fix for running core grafana
ulimit -f 2097152
ulimit -c 2097152
ulimit -n 2097152