Skip to content

Instantly share code, notes, and snippets.

@OctavioBR
Last active May 22, 2019 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OctavioBR/7c16759e32403ca3615e3a55a7b8f2ce to your computer and use it in GitHub Desktop.
Save OctavioBR/7c16759e32403ca3615e3a55a7b8f2ce to your computer and use it in GitHub Desktop.
zsh config
This gist tracks my zsh configurations
Profiles for both OSX & Linux
# Put hthis inside .oh-my-zsh/custom/themes/terminalparty.zsh-theme
PROMPT='%(?,%{$fg[green]%},%{$fg[red]%})%% '
# RPS1='%{$fg[blue]%}%~%{$reset_color%} '
RPS1='%{$fg[white]%}%2~$(git_prompt_info) %{$fg_bold[blue]%}%m%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}%{$fg[yellow]%}"
export ZSH=/Users/octavio/.oh-my-zsh
ZSH_THEME="bullet-train"
plugins=(git osx docker)
# bullet-train theme options
export BULLETTRAIN_TIME_SHOW=false
export BULLETTRAIN_PROMPT_ADD_NEWLINE=false
export BULLETTRAIN_STATUS_EXIT_SHOW=true
export BULLETTRAIN_EXEC_TIME_SHOW=true
export BULLETTRAIN_CONTEXT_SHOW=true
export BULLETTRAIN_RUBY_SHOW=false
export BULLETTRAIN_NVM_SHOW=false
# Set OSX locale env
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
NPM_PACKAGES="$HOME/.npm-packages"
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
PATH="$NPM_PACKAGES/bin:/usr/local/git/bin:$PATH"
MANPATH="$MANPATH:$NPM_PACKAGES/share/man:$(manpath)"
#Go workspace
export GOPATH="$HOME/Code/go"
PATH=$PATH:$GOPATH/bin
# Docker-machine / Boot2Docker
eval "$(docker-machine env)"
export PATH
export MANPATH
export TERM="xterm-256color" #Term theming
source $ZSH/oh-my-zsh.sh
# ~~~~~~~~~ Custom Aliases ~~~~~~~~~
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias t=trash
alias h=history
alias ss="/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine"
alias finder=ofd
alias serve='python -m SimpleHTTPServer'
# Docker & Kubernetes
alias dps="docker ps --format \"{{.Image}}\t{{.Names}}\t{{.Status}}\""
alias dpa="docker ps --format \"{{.Image}}\t{{.Names}}\t{{.Status}}\" -a"
alias dcl="docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs docker rm"
alias dci="docker rmi -f $(docker images --filter "dangling=true" -q)"
alias kb=kubectl
# Project home links
alias github='cd ~/Code/github'
alias gitlab='cd ~/Code/gitlab'
# Yarn query latest package release
function yarn-latest() { yarn info $1 dist-tags.latest }
# NPM completion
source <(npm completion)
# K8s completions
source <(kubectl completion zsh)
# Helm completion
# source <(helm completion zsh)
# Gulp completion
# eval "$(gulp --completion=zsh)"
# Azure CLI completion
# source '~/lib/azure-cli/az.completion'
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='atom'
else
export EDITOR='vi'
fi
export SSH_KEY_PATH="~/.ssh/dsa_id"
OSX_PLUGIN_HELP=$(cat <<EOF
| Command | Description |\n
|:--------------|:-----------------------------------------------|\n
| 'tab' | Open the current directory in a new tab |\n
| 'ofd' | Open the current directory in a Finder window |\n
| 'pfd' | Return the path of the frontmost Finder window |\n
| 'pfs' | Return the current Finder selection |\n
| 'cdf' | 'cd' to the current Finder directory |\n
| 'pushdf' | 'pushd' to the current Finder directory |\n
| 'quick-look' | Quick-Look a specified file |\n
| 'man-preview' | Open a specified man page in Preview app |\n
EOF)
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="bullet-train"
plugins=(git docker colorize)
# bullet-train theme options
export BULLETTRAIN_TIME_SHOW=false
export BULLETTRAIN_PROMPT_ADD_NEWLINE=false
export BULLETTRAIN_STATUS_EXIT_SHOW=true
export BULLETTRAIN_EXEC_TIME_SHOW=true
export BULLETTRAIN_CONTEXT_SHOW=true
export BULLETTRAIN_RUBY_SHOW=false
export BULLETTRAIN_NVM_SHOW=false
# ~~~~~~~~~ Environment ~~~~~~~~~~~~
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
MANPATH="/usr/local/man:$MANPATH"
# Variables to use NPM packages without sudo
NPM_PACKAGES="$HOME/.npm-global"
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
PATH="$NPM_PACKAGES/bin:$PATH"
MANPATH="$NPM_PACKAGES/share/man:$MANPATH"
# JetBrains IDEs
PATH="$HOME/Code/tools/WebStorm/bin:$PATH"
PATH="$HOME/Code/tools/Gogland/bin:$PATH"
# Go workspace
PATH="/usr/local/go/bin:$PATH"
export GOPATH="$HOME/Code/go"
PATH=$PATH:$GOPATH/bin
# Add RVM (ruby) in PATH for scripting
PATH="$PATH:$HOME/.rvm/bin"
# Azure CLI
PATH="$PATH:$HOME/bin"
export PATH
export MANPATH
export TERM="xterm-256color" #Term theming
# ~~~~~~~~~ Custom Aliases ~~~~~~~~~
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# 3rd party tools
alias t=trash
alias clip='xclip -selection clipboard'
alias serve='python -m SimpleHTTPServer'
# Docker & Kubernetes
alias dps="docker ps --format \"{{.Image}}\t{{.Names}}\t{{.Status}}\""
alias dpa="docker ps --format \"{{.Image}}\t{{.Names}}\t{{.Status}}\" -a"
alias dcl="docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs docker rm"
alias dci="docker rmi -f $(docker images --filter "dangling=true" -q)"
alias kb=kubectl
alias kbctx="kubectl config set current-context"
alias kbgctx="kubectl config current-context"
# Go Github projects
alias github='cd ~/Code/go/src/github.com'
# Neoway projects
alias ingleses='cd ~/Code/go/src/gitlab.neoway.com.br/ingleses'
alias galheta='cd ~/Code/galheta'
alias maho='cd ~/Code/maho'
alias dungeons='cd ~/Code/dungeons'
alias pontal='cd ~/Code/pontal/search-awesome-application/projects'
alias san-andres='cd ~/Code/san-andres/leads-awesome-application/projects'
# Postgress connections
alias pg_dev='psql -h 192.168.111.222 -U maps -d maps'
alias pg_qa='psql -h 10.102.3.51 -U maps -d maps'
# KDE utilities
alias restart_plasma="killall plasmashell && kstart plasmashell"
alias config_dp1="xrandr --output eDP-1 --auto --output DP-1 --auto --panning 3840x2160+2880+0 --scale 2x2 --right-of eDP-1"
alias config_dp2="xrandr --output eDP-1 --auto --output DP-2 --auto --panning 3840x2160+2880+0 --scale 2x2 --right-of eDP-1"
alias unlock="loginctl unlock-sessions"
alias zshconfig='atom ~/.zshrc'
alias ohmyzsh='atom ~/.oh-my-zsh'
alias sublimeconfig='cd ~/.config/sublime-text-3/Packages/User'
# NPM completion
source <(npm completion)
# K8s completion
source <(kubectl completion zsh)
# Helm completion
source <(helm completion zsh)
# Gulp completion
eval "$(gulp --completion=zsh)"
# Azure CLI completion
source '/home/octavio/lib/azure-cli/az.completion'
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='atom'
else
export EDITOR='vi'
fi
# Compilation flags
export ARCHFLAGS="-arch x86_64"
source $ZSH/oh-my-zsh.sh
# ~~~~~~~~~ ZSH generated ~~~~~~~~~~
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment