Last active
March 6, 2019 16:49
-
-
Save devCharles/eeed2f1f2a3f09f33a2d071039883ae3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh installation. | |
export ZSH="/home/charles/.oh-my-zsh" | |
################## SPACE SHIP THEME VARIABLES ################### | |
SPACESHIP_CHAR_SYMBOL=">> " | |
SPACESHIP_PACKAGE_SHOW=false | |
SPACESHIP_BATTERY_SHOW=false | |
SPACESHIP_DOCKER_SHOW=false | |
SPACESHIP_NODE_SHOW=false | |
######################### PRESET | |
# USER | |
# SPACESHIP_USER_PREFIX="" # remove `with` before username | |
# SPACESHIP_USER_SUFFIX="" # remove space before host | |
# HOST | |
# Result will look like this: | |
# username@:(hostname) | |
SPACESHIP_HOST_PREFIX="@:(" | |
SPACESHIP_HOST_SUFFIX=") " | |
# DIR | |
SPACESHIP_DIR_PREFIX=">>>" | |
SPACESHIP_DIR_TRUNC='3' # show only last directory | |
# GIT | |
# Disable git symbol | |
SPACESHIP_GIT_SYMBOL="" # git prefix | |
SPACESHIP_GIT_BRANCH_PREFIX="" # disable branch prefix too | |
# Wrap git in `git:(...)` | |
SPACESHIP_GIT_PREFIX=" π ( " | |
SPACESHIP_GIT_SUFFIX=" )" | |
SPACESHIP_GIT_BRANCH_SUFFIX=" " # remove space after branch name | |
# Unwrap git status from `[...]` | |
# SPACESHIP_GIT_STATUS_PREFIX="" | |
# SPACESHIP_GIT_STATUS_SUFFIX="" | |
# NODE | |
SPACESHIP_NODE_PREFIX="node:(" | |
SPACESHIP_NODE_SUFFIX=") " | |
SPACESHIP_NODE_SYMBOL="" | |
################################################################# | |
ZSH_THEME="spaceship" | |
plugins=( | |
git | |
) | |
source $ZSH/oh-my-zsh.sh | |
############# ALIASES ############### | |
# --- GIT π | |
alias gcall='git add -A && git commit -m' | |
alias gch='git checkout' | |
# --- DOCKER π³ | |
alias dk='docker' | |
alias dki='docker images' | |
alias dkps='docker ps' | |
alias dkpsa='docker ps -a' | |
alias dkrmi='docker rmi' | |
alias dkrm='docker rm' | |
# --- utils | |
alias alv='reset' | |
alias starts='sudo systemctl start' | |
alias stops='sudo systemctl stop' | |
alias restarts='sudo systemctl restart' | |
alias open='xdg-open' | |
# --- leco | |
alias kore='cd /home/charles/code/leco/kore' | |
alias ssh-leco-db='ssh -L 27001:localhost:27017 [email protected] -fN' | |
alias ssh-dev-leco-db='ssh -L 27002:localhost:27017 [email protected] -fN' | |
###-begin-npm-completion-### | |
# | |
# npm command completion script | |
# | |
# Installation: npm completion >> ~/.bashrc (or ~/.zshrc) | |
# Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm | |
# | |
if type complete &>/dev/null; then | |
_npm_completion () { | |
local words cword | |
if type _get_comp_words_by_ref &>/dev/null; then | |
_get_comp_words_by_ref -n = -n @ -n : -w words -i cword | |
else | |
cword="$COMP_CWORD" | |
words=("${COMP_WORDS[@]}") | |
fi | |
local si="$IFS" | |
IFS=$'\n' COMPREPLY=($(COMP_CWORD="$cword" \ | |
COMP_LINE="$COMP_LINE" \ | |
COMP_POINT="$COMP_POINT" \ | |
npm completion -- "${words[@]}" \ | |
2>/dev/null)) || return $? | |
IFS="$si" | |
if type __ltrim_colon_completions &>/dev/null; then | |
__ltrim_colon_completions "${words[cword]}" | |
fi | |
} | |
complete -o default -F _npm_completion npm | |
elif type compdef &>/dev/null; then | |
_npm_completion() { | |
local si=$IFS | |
compadd -- $(COMP_CWORD=$((CURRENT-1)) \ | |
COMP_LINE=$BUFFER \ | |
COMP_POINT=0 \ | |
npm completion -- "${words[@]}" \ | |
2>/dev/null) | |
IFS=$si | |
} | |
compdef _npm_completion npm | |
elif type compctl &>/dev/null; then | |
_npm_completion () { | |
local cword line point words si | |
read -Ac words | |
read -cn cword | |
let cword-=1 | |
read -l line | |
read -ln point | |
si="$IFS" | |
IFS=$'\n' reply=($(COMP_CWORD="$cword" \ | |
COMP_LINE="$line" \ | |
COMP_POINT="$point" \ | |
npm completion -- "${words[@]}" \ | |
2>/dev/null)) || return $? | |
IFS="$si" | |
} | |
compctl -K _npm_completion npm | |
fi | |
###-end-npm-completion-### | |
## init z completion script | |
. ~/code/tools/z/z.sh | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment