Skip to content

Instantly share code, notes, and snippets.

@itolosa
Created September 2, 2022 22:45
Show Gist options
  • Save itolosa/08ac4adbe4b8f8920091d248e9d7f79a to your computer and use it in GitHub Desktop.
Save itolosa/08ac4adbe4b8f8920091d248e9d7f79a to your computer and use it in GitHub Desktop.
ultimo zshrc
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="powerlevel10k/powerlevel10k"
plugins=(evalcache rbenv brew zsh-nvm virtualenv autojump pip python urltools zsh-autosuggestions)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(context status anaconda virtualenv)
CASE_SENSITIVE="false"
DISABLE_AUTO_TITLE="true"
COMPLETION_WAITING_DOTS="true"
zmodload zsh/zprof
source $ZSH/oh-my-zsh.sh
# autoload -Uz compinit && compinit
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
alias rm="rm -i"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~"
alias -- -="cd -"
alias reload="exec $SHELL -l"
# Enable aliases to be sudoed
alias sudo='sudo '
# Always enable colored `grep` output
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
else # OS X `ls`
colorflag="-G"
fi
alias ring="paplay /usr/share/sounds/freedesktop/stereo/complete.oga"
# don't expand aliases _before_ completion has finished
# like: git comm-[tab]
setopt complete_aliases
# processes
setopt NO_BG_NICE
setopt NO_HUP
setopt NO_LIST_BEEP
setopt LOCAL_OPTIONS
setopt LOCAL_TRAPS
# history
setopt HIST_VERIFY
setopt SHARE_HISTORY
setopt EXTENDED_HISTORY
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY SHARE_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_REDUCE_BLANKS
# shell
setopt PROMPT_SUBST
setopt CORRECT
setopt COMPLETE_IN_WORD
setopt IGNORE_EOF
setopt AUTO_PUSHD
# zsh
export UPDATE_ZSH_DAYS=14
# locales
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
# rails
export default_rails_env=development
export RUBY_GC_MALLOC_LIMIT=1073741824
export RUBY_GC_HEAP_FREE_SLOTS=524288
export RUBY_GC_HEAP_INIT_SLOTS=65536
# editor
export VISUAL='vim'
export EDITOR='vim'
export GIT_EDITOR='vim'
export LS_OPTIONS='-G';
# nvm
export NVM_DIR="$HOME/.nvm"
export NVM_LAZY_LOAD=true
export NVM_COMPLETION=true
# vars for paths
export ANSIBLE_HOSTS="/etc/ansible/hosts"
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
export RUBYOPT="-W:no-deprecated"
export VIRTUAL_ENV_DISABLE_PROMPT=""
export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2)
export ADB_SERVER_SOCKET="tcp:$WSL_HOST:5037"
export ANDROID_HOME="$HOME/Android"
export ANDROID_SDK_ROOT="$HOME/Android"
# paths
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/share/npm/bin:$PATH"
export PATH="/usr/bin:$PATH"
export PATH="/bin:$PATH"
export PATH="/usr/sbin:$PATH"
export PATH="/sbin:$PATH"
export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
export PATH="$HOME/.myscripts/bin:$PATH"
export PATH="$HOME/.astyle/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/.pyenv/bin:$PATH"
export PATH="$HOME/.pyenv/shims:$PATH"
export PATH="$ANDROID_SDK_ROOT/platform-tools:$PATH"
export PATH="$ANDROID_HOME/cmdline-tools/latest:$PATH"
eval "$(/opt/homebrew/bin/brew shellenv)"
_evalcache pyenv init --path
_evalcache pyenv virtualenv-init -
if command -v rbenv 2> /dev/null; then
_evalcache rbenv init - --no-rehash;
fi
env=~/.ssh/agent.env
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }
agent_start () {
(umask 077; ssh-agent >| "$env")
. "$env" >| /dev/null ; }
agent_load_env
# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?)
if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then
agent_start
ssh-add
elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then
ssh-add
fi
unset env
__conda_setup="$(\"$HOME/miniconda3/bin/conda\" \"shell.zsh\" \"hook\" 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then
. "$HOME/miniconda3/etc/profile.d/conda.sh"
else
export PATH="$HOME/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
extract () {
if [ -f $1 ]; then
case $1 in
*.tar.bz2) tar -jxvf $1 ;;
*.tar.gz) tar -zxvf $1 ;;
*.bz2) bunzip2 $1 ;;
*.dmg) hdiutil mount $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar -xvf $1 ;;
*.tbz2) tar -jxvf $1 ;;
*.tgz) tar -zxvf $1 ;;
*.zip) unzip $1 ;;
*.ZIP) unzip $1 ;;
*.pax) cat $1 | pax -r ;;
*.pax.Z) uncompress $1 --stdout | pax -r ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted/mounted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# Like pgrep, just in case.
psg() {
if [ ! -z $1 ] ; then
echo "Grepping for processes matching $1..."
ps aux | egrep "PID|$1" | grep -v grep
else
echo "!! Need name to grep for"
fi
}
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# tabtab source for packages
# uninstall by removing these lines
[[ -f ~/.config/tabtab/__tabtab.zsh ]] && . ~/.config/tabtab/__tabtab.zsh || true
[ -f "/home/nachoman/.ghcup/env" ] && source "/home/nachoman/.ghcup/env" # ghcup-env
export LDFLAGS="-L/opt/homebrew/opt/zlib/lib"
export CPPFLAGS="-I/opt/homebrew/opt/zlib/include"
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
alias get_idf='. $HOME/esp/esp-idf/export.sh'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment