-
Notifications
You must be signed in to change notification settings - Fork 0
/
_zshrc
122 lines (97 loc) · 3.37 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
# TODO: Run Prettier
# See https://www.reddit.com/r/bash/comments/pxvmg6/code_formatter_linters_etc_recommendations/
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$HOME/.local/bin:$HOME/.config/composer/vendor/bin:$PATH
# Disable compfix for insecure directories.
ZSH_DISABLE_COMPFIX=true
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Theme
ZSH_THEME="robbyrussell"
# Case-sensitivity and completion settings
CASE_SENSITIVE="true"
HYPHEN_INSENSITIVE="true"
ENABLE_CORRECTION="true"
COMPLETION_WAITING_DOTS="true"
# Plugins
plugins=(
docker
docker-compose
node
npm
python
zsh-autosuggestions
zsh-syntax-highlighting
laravel
kubectl
git-extras
)
source $ZSH/oh-my-zsh.sh
# User configuration
# Preferred editor for local and remote sessions
if [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then
export EDITOR='vi'
export COMPOSER_ALLOW_SUPERUSER=1
else
export EDITOR='vim'
fi
#TODO: Make sdkman work well with Android
# Java settings
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
export JAVA_OPTS=''
# Android SDK settings
if [[ -d "$HOME/Android" ]]; then
export ANDROID_HOME=$HOME/Android
export PATH=$PATH:$ANDROID_HOME/Sdk/emulator
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
fi
# Pyenv settings
if [[ -d "$HOME/.pyenv" ]]; then
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=~/.virtualenvs
source $HOME/.local/bin/virtualenvwrapper.sh
PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true"
fi
# Language environment
export LANG=en_US.UTF-8
# SSH settings
export SSH_KEY_PATH="~/.ssh/rsa_id"
# Perl settings
export PATH="/home/joshua/perl5/bin${PATH:+:${PATH}}"
export PERL5LIB="/home/joshua/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"
export PERL_LOCAL_LIB_ROOT="/home/joshua/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"
export PERL_MB_OPT="--install_base /home/joshua/perl5"
export PERL_MM_OPT="INSTALL_BASE=/home/joshua/perl5"
# Aliases and Helpers
# Dotfiles
alias dotconfig="vi ~/dotfiles"
# Switch to dotfiles directory and edit
function _dotconfig {
local last_cwd=$(pwd)
cd ~/.dotfiles && vi . && cd "$last_cwd"
}
# Git aliases
alias wip="git add . && git commit -am 'wip'"
alias commit-amend="git add . && git commit --amend"
alias gitlog="git log --oneline"
# TODO: Use vim-fugitivie bindings as zsh aliases
# TODO: Fix: aliases aren't read from Vim cli
# Laravel aliases
alias laravel-clear-cache="php artisan cache:clear && php artisan view:clear && php artisan route:clear && php artisan clear-compiled && php artisan config:cache"
alias laravel-fresh-migrate="php artisan migrate:fresh --seed"
alias laravel-fresh-migrate-cache="laravel-fresh-migrate && laravel-clear-cache"
alias laravel-create-sqlitedb='[ -d "$(pwd)/database" ] && touch "$(pwd)/database/database.sqlite" || echo "Error: Directory $(pwd)/database does not exist."'
# ZSH aliases
alias ohmyzsh="vi ~/.oh-my-zsh"
alias zshsource="source ~/.zshrc"
alias zshconfig="vi ~/.zshrc"
alias zshedit="zshconfig && zshsource"
# yt-dlp aliases
alias downloadyt="yt-dlp"
alias youtube-dl="downloadyt"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export NODE_PATH=$(npm root -g)