Skip to content

Instantly share code, notes, and snippets.

@mtanzi
Created January 24, 2019 12:15
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 mtanzi/771ef577a3ac5de67a5f98204b89cd0d to your computer and use it in GitHub Desktop.
Save mtanzi/771ef577a3ac5de67a5f98204b89cd0d to your computer and use it in GitHub Desktop.
zshell - Presto dotfiles
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
# Set case-sensitivity for completion, history lookup, etc.
# zstyle ':prezto:*:*' case-sensitive 'yes'
# Color output (auto set to 'no' on dumb terminals).
zstyle ':prezto:*:*' color 'yes'
# Set the Zsh modules to load (man zshmodules).
# zstyle ':prezto:load' zmodule 'attr' 'stat'
# Set the Zsh functions to load (man zshcontrib).
# zstyle ':prezto:load' zfunction 'zargs' 'zmv'
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'prompt' \
'history-substring-search' \
'syntax-highlighting' \
'ssh' \
'tmux' \
'git'
#
# Autosuggestions
#
# Set the query found color.
# zstyle ':prezto:module:autosuggestions:color' found ''
#
# Editor
#
# Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' key-bindings 'vi'
# Auto convert .... to ../..
# zstyle ':prezto:module:editor' dot-expansion 'yes'
#
# Git
#
# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'.
# zstyle ':prezto:module:git:status:ignore' submodules 'all'
#
# GNU Utility
#
# Set the command prefix on non-GNU systems.
# zstyle ':prezto:module:gnu-utility' prefix 'g'
#
# History Substring Search
#
# Set the query found color.
# zstyle ':prezto:module:history-substring-search:color' found ''
# Set the query not found color.
# zstyle ':prezto:module:history-substring-search:color' not-found ''
# Set the search globbing flags.
# zstyle ':prezto:module:history-substring-search' globbing-flags ''
#
# Pacman
#
# Set the Pacman frontend.
# zstyle ':prezto:module:pacman' frontend 'yaourt'
#
# Prompt
#
# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
zstyle ':prezto:module:prompt' theme 'wikimatze'
# zstyle ':prezto:module:prompt' theme 'josh'
#
# Ruby
#
# Auto switch the Ruby version on directory change.
# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes'
#
# Screen
#
# Auto start a session when Zsh is launched in a local terminal.
# zstyle ':prezto:module:screen:auto-start' local 'yes'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:screen:auto-start' remote 'yes'
#
# SSH
#
# Set the SSH identities to load into the agent.
zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github' 'id_rsa.github'
#
# Syntax Highlighting
#
# Set syntax highlighters.
# By default, only the main highlighter is enabled.
# zstyle ':prezto:module:syntax-highlighting' highlighters \
# 'main' \
# 'brackets' \
# 'pattern' \
# 'line' \
# 'cursor' \
# 'root'
#
# Set syntax highlighting styles.
# zstyle ':prezto:module:syntax-highlighting' styles \
# 'builtin' 'bg=blue' \
# 'command' 'bg=blue' \
# 'function' 'bg=blue'
#
# Terminal
#
# Auto set the tab and window titles.
# zstyle ':prezto:module:terminal' auto-title 'yes'
# Set the window title format.
# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s'
# Set the tab title format.
# zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
#
# Tmux
#
# Auto start a session when Zsh is launched in a local terminal.
# zstyle ':prezto:module:tmux:auto-start' local 'yes'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:tmux:auto-start' remote 'yes'
# Integrate with iTerm2.
zstyle ':prezto:module:tmux:iterm' integrate 'yes'
#
# Executes commands at login pre-zshrc.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# Browser
#
if [[ "$OSTYPE" == darwin* ]]; then
export BROWSER='open'
fi
#
# Editors
#
export EDITOR='vim'
export VISUAL='vim'
export PAGER='less'
#
# Language
#
if [[ -z "$LANG" ]]; then
export LANG='en_US.UTF-8'
fi
#
# Paths
#
# Ensure path arrays do not contain duplicates.
typeset -gU cdpath fpath mailpath path
# Set the the list of directories that cd searches.
# cdpath=(
# $cdpath
# )
# Set the list of directories that Zsh searches for programs.
path=(
/usr/local/{bin,sbin}
$path
)
#
# Less
#
# Set the default Less options.
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing).
# Remove -X and -F (exit if the content fits on one screen) to enable it.
export LESS='-F -g -i -M -R -S -w -X -z-4'
# Set the Less input preprocessor.
# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system.
if (( $#commands[(i)lesspipe(|.sh)] )); then
export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-"
fi
#
# Temporary Files
#
if [[ ! -d "$TMPDIR" ]]; then
export TMPDIR="/tmp/$LOGNAME"
mkdir -p -m 700 "$TMPDIR"
fi
TMPPREFIX="${TMPDIR%/}/zsh"
#
# Defines environment variables.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Ensure that a non-login, non-interactive shell has a defined environment.
if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
source "${ZDOTDIR:-$HOME}/.zprofile"
fi
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
## ALIASES
alias tmux="TERM=screen-256color-bce tmux"
alias xi="open /Users/mtanzi/Projects/xi-mac/build/Release/XiEditor.app"
# activate tensorflow
alias tfon="source ~/tensorflow/bin/activate"
alias tfoff="deactivate"
## GPG
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
eval $(gpg-agent --daemon)
fi
export GPG_TTY=$(tty)
# PATH
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# Rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
# Anaconda
# export PATH=/Users/mtanzi/anaconda2/bin:$PATH
# Rustup
# export PATH=/Users/mtanzi/.cargo/bin:$PATH
export PATH="$HOME/.cargo/bin:$PATH"
# Source emcc
# source /Users/mtanzi/emsdk-portable/emsdk_env.sh
# chruby
# source /usr/local/opt/chruby/share/chruby/chruby.sh # mandatory
# source /usr/local/opt/chruby/share/chruby/auto.sh # if you want auto-switching
# chruby ruby-2.4.0
# tmuxinator
source ~/.bin/tmuxinator.zsh
# SSH agent workaround
# eval "$(ssh-agent -s)"
# ssh-add -K ~/.ssh/id_rsa
{ eval `ssh-agent`; ssh-add -A; } &>/dev/null
# Direnv
eval "$(direnv hook zsh tmux)"
# Go settings
export PATH=$PATH:$(go env GOPATH)/bin
export GOPATH=$(go env GOPATH)
# tabtab source for serverless package
# uninstall by removing these lines or running `tabtab uninstall serverless`
[[ -f /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh ]] && . /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh
# tabtab source for sls package
# uninstall by removing these lines or running `tabtab uninstall sls`
[[ -f /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh ]] && . /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Applications/google-cloud-sdk/path.zsh.inc' ]; then . '/Applications/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Applications/google-cloud-sdk/completion.zsh.inc' ]; then . '/Applications/google-cloud-sdk/completion.zsh.inc'; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment