Skip to content

Instantly share code, notes, and snippets.

@GiuseppeMP
Last active March 8, 2020 22:07
Show Gist options
  • Save GiuseppeMP/a8f6e774e052cce9fc4d38702c7c96a5 to your computer and use it in GitHub Desktop.
Save GiuseppeMP/a8f6e774e052cce9fc4d38702c7c96a5 to your computer and use it in GitHub Desktop.
zshrc beppe 03-08-20
export PATH=$HOME/bin:/usr/local/bin:$PATH
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export ARCHFLAGS="-arch x86_64"
export ZSH="/Users/giuseppe/.oh-my-zsh"
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-8-openj9.jdk/Contents/Home"
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
## vi mode
#bindkey -v
#export KEYTIMEOUT=1
#
## Use vim keys in tab complete menu:
#bindkey -M menuselect 'h' vi-backward-char
#bindkey -M menuselect 'k' vi-up-line-or-history
#bindkey -M menuselect 'l' vi-forward-char
#bindkey -M menuselect 'j' vi-down-line-or-history
#bindkey -v '^?' backward-delete-char
#
# Use lf to switch directories and bind it to ctrl-o
# https://github.com/gokcehan/lf
lfcd () {
tmp="$(mktemp)"
lf -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
rm -f "$tmp"
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
fi
}
bindkey -s '^o' 'lfcd\n'
# Edit line in vim with ctrl-e:
autoload edit-command-line; zle -N edit-command-line
bindkey '^e' edit-command-line
ZSH_THEME="spaceship"
# spaceship config
SPACESHIP_EXIT_CODE_SHOW=true
SPACESHIP_KUBECTL_SHOW=true
SPACESHIP_HOST_PREFIX="@:("
SPACESHIP_HOST_SUFFIX=") "
SPACESHIP_CHAR_PREFIX="🚀 "
SPACESHIP_PROMPT_FIRST_PREFIX_SHOW=true
SPACESHIP_DIR_PREFIX="📂 "
SPACESHIP_EXIT_CODE_SYMBOL="🤷 "
SPACESHIP_USER_SHOW=always
SPACESHIP_USER_PREFIX="🤖 with ["
SPACESHIP_USER_SUFFIX="] in "
SPACESHIP_VI_MODE_COLOR=green
#SPACESHIP_VI_MODE_INSERT=
#SPACESHIP_VI_MODE_NORMAL=
SPACESHIP_PROMPT_ORDER=(
time # Time stamps section
user # Username section
dir # Current directory section
host # Hostname section
git # Git section (git_branch + git_status)
hg # Mercurial section (hg_branch + hg_status)
package # Package version
node # Node.js section
ruby # Ruby section
elixir # Elixir section
xcode # Xcode section
swift # Swift section
golang # Go section
php # PHP section
rust # Rust section
haskell # Haskell Stack section
julia # Julia section
docker # Docker section
aws # Amazon Web Services section
venv # virtualenv section
conda # conda virtualenv section
pyenv # Pyenv section
dotnet # .NET section
ember # Ember.js section
kubectl # Kubectl context section
terraform # Terraform workspace section
exec_time # Execution time
line_sep # Line break
battery # Battery level and status
vi_mode # Vi-mode indicator
jobs # Background jobs indicator
exit_code # Exit code section
char # Prompt character
docker_context
)
plugins=(
osx
brew
git
#vi-mode
magic-enter
history-search-multi-word
zsh-syntax-highlighting
zsh-autosuggestions
)
source $ZSH/oh-my-zsh.sh
MAGIC_ENTER_GIT_COMMAND="git status -u ."
MAGIC_ENTER_OTHER_COMMAND="ls -lhar ."
export MANPATH="/usr/local/man:$MANPATH"
GATLING_HOME=~/Environment/gatling-charts-highcharts-bundle-3.3.1/bin
export PATH=$GATLING_HOME:$PATH
FIREFOX_BIN=/Applications/Firefox.app/Contents/MacOS
export PATH=$FIREFOX_BIN:$PATH
KAFKA_BIN=~/Environment/kafka/bin
export PATH=$KAFKA_BIN:$PATH
CCLOUD_PATH=~/Environment/ccloud
export PATH=$CCLOUD_PATH:$PATH
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/giuseppe/Downloads/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/giuseppe/Downloads/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/giuseppe/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/giuseppe/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
alias npm_reset="rm -rf node_modules && npm i && rm -rf coverage && npm test --u"
alias yarn_reset="rm -rf node_modules && yarn && rm -rf coverage && yarn test --u"
alias binstall="brew install "
alias bsearch="brew search"
alias uport="lsof -i :"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment