updating the zsh and macos options. macos not ready for primetime
This commit is contained in:
parent
94c94dab26
commit
a4d559f689
4 changed files with 68 additions and 79 deletions
20
mac-files/setup_mac.sh
Normal file
20
mac-files/setup_mac.sh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
install_homebrew() {
|
||||
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
}
|
||||
|
||||
grab_dependencies() {
|
||||
brew install git
|
||||
brew install vim
|
||||
brew install zsh
|
||||
brew install caskroom/cask/brew-cask
|
||||
}
|
||||
|
||||
main() {
|
||||
# abort if homebrew is already installed; we don't want to accidentaly stomp on things
|
||||
if hash brew 2>/dev/null; then
|
||||
exit(0)
|
||||
install_homebrew
|
||||
grab_dependencies
|
||||
}
|
||||
|
||||
main
|
||||
9
zsh-files/exports.zsh
Normal file
9
zsh-files/exports.zsh
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Colors in grep
|
||||
export GREP_OPTIONS='--color=auto'
|
||||
export GREP_COLOR='3;33'
|
||||
|
||||
# venv
|
||||
export VENVS_DIR=$HOME/.virtualenvs
|
||||
|
||||
# Vim is Life, Vim is Happiness
|
||||
export EDITOR=vim
|
||||
20
zsh-files/zsh_opts.zsh
Normal file
20
zsh-files/zsh_opts.zsh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
setopt no_beep # don't beep on error
|
||||
setopt interactive_comments # Allow comments even in interactive shells
|
||||
bindkey -v # Vim is king, Vim is life
|
||||
|
||||
# ===== Navigation
|
||||
setopt pushd_ignore_dups
|
||||
|
||||
# ===== Completion
|
||||
setopt always_to_end # When completing from the middle of a word, move the cursor to the end of the word
|
||||
setopt auto_menu # show completion menu on successive tab press. needs unsetop menu_complete to work
|
||||
setopt auto_name_dirs # any parameter that is set to the absolute name of a directory immediately becomes a name for that directory
|
||||
setopt complete_in_word # Allow completion from within a word/phrase
|
||||
|
||||
unsetopt menu_complete # do not autoselect the first completion entry
|
||||
|
||||
# ===== Prompt
|
||||
setopt prompt_subst
|
||||
|
||||
autoload predict-on
|
||||
predict-on
|
||||
|
|
@ -1,59 +1,32 @@
|
|||
# Path to your oh-my-zsh configuration.
|
||||
ZSH=$HOME/.oh-my-zsh
|
||||
HISTFILE=~/.histfile
|
||||
HISTSIZE=1000
|
||||
SAVEHIST=1000
|
||||
|
||||
# Set name of the theme to load.
|
||||
# Look in ~/.oh-my-zsh/themes/
|
||||
# Optionally, if you set this to "random", it'll load a random theme each
|
||||
# time that oh-my-zsh is loaded.
|
||||
ZSH_THEME="juanghurtado"
|
||||
source ~/antigen.zsh
|
||||
|
||||
# Example aliases
|
||||
# alias zshconfig="mate ~/.zshrc"
|
||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||
antigen use oh-my-zsh
|
||||
|
||||
# Set to this to use case-sensitive completion
|
||||
# CASE_SENSITIVE="true"
|
||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
||||
antigen bundle zsh-users/zsh-history-substring-search
|
||||
antigen bundle rupa/z
|
||||
antigen bundle git
|
||||
|
||||
# Comment this out to disable bi-weekly auto-update checks
|
||||
# DISABLE_AUTO_UPDATE="true"
|
||||
# OSX specific
|
||||
antigen bundle brew
|
||||
antigen bundle brew-cask
|
||||
|
||||
# Uncomment to change how often before auto-updates occur? (in days)
|
||||
# export UPDATE_ZSH_DAYS=13
|
||||
antigen theme bureau
|
||||
|
||||
# Uncomment following line if you want to disable colors in ls
|
||||
# DISABLE_LS_COLORS="true"
|
||||
antigen apply
|
||||
|
||||
# Uncomment following line if you want to disable autosetting terminal title.
|
||||
# DISABLE_AUTO_TITLE="true"
|
||||
source ~/dotfiles/zsh-files/zsh_opts.zsh
|
||||
source ~/dotfiles/zsh-files/exports.zsh
|
||||
|
||||
# Uncomment following line if you want to disable command autocorrection
|
||||
# DISABLE_CORRECTION="true"
|
||||
|
||||
# Uncomment following line if you want red dots to be displayed while waiting for completion
|
||||
# COMPLETION_WAITING_DOTS="true"
|
||||
zstyle :compinstall filename '/Users/haak/.zshrc'
|
||||
|
||||
# Uncomment 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"
|
||||
|
||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
|
||||
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
plugins=(git)
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
# Customize to your needs...
|
||||
|
||||
# Powerline!
|
||||
#. ~/dotfiles/misc-files/powerline/powerline/bindings/zsh/powerline.zsh
|
||||
# export PYTHONPATH=~/.vim/bundle/powerline:$PYTHONPATH
|
||||
#
|
||||
|
||||
alias vim="~/local/bin/vim"
|
||||
export PATH=~/local/bin:~/dotfiles/bin:$PATH
|
||||
export EDITOR=vim
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
function branch_prompt {
|
||||
BRANCH=$(current_branch)
|
||||
|
|
@ -75,36 +48,3 @@ fancy-ctrl-z () {
|
|||
}
|
||||
zle -N fancy-ctrl-z
|
||||
bindkey '^Z' fancy-ctrl-z
|
||||
|
||||
function in_sandbox {
|
||||
if [ ! -z "${YELP_IN_SANDBOX}" ]; then
|
||||
echo " (sandbox)"
|
||||
fi
|
||||
if [ ! -z "${SELENIUM_PORT}" ]; then
|
||||
echo " (selenium)"
|
||||
fi
|
||||
}
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_AHEAD=" %{$YELLOW%}⇈%{$RESET_COLOR%}"
|
||||
ZSH_THEME_GIT_PROMPT_BEHIND=" %{$YELLOW%}⇊%{$RESET_COLOR%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIVERGED=" %{$YELLOW%}⇅%{$RESET_COLOR%}"
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$YELLOW%}[U]%{$RESET_COLOR%}"
|
||||
ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$RED%}☢%{$RESET_COLOR%}"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}⑂%{$RESET_COLOR%}"
|
||||
ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}[D]%{$RESET_COLOR%}"
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}[R]%{$RESET_COLOR%}"
|
||||
ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}⇶%{$RESET_COLOR%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RED%}☢%{$RESET_COLOR%}"
|
||||
|
||||
function in_venv {
|
||||
VIRTUALENV_DISPLAY_STRING=${VIRTUAL_ENV##*/}
|
||||
if [ ! -z "$VIRTUALENV_DISPLAY_STRING" ]; then
|
||||
echo "($VIRTUALENV_DISPLAY_STRING) "
|
||||
fi
|
||||
}
|
||||
|
||||
PROMPT='
|
||||
%{$fg_bold[green]%}[%n@%m]%{$fg[white]%} $(in_venv)%{$fg[yellow]%}[%~]%{$reset_color%}
|
||||
$(in_sandbox)%{$fg[blue]%}>%{$reset_color%} '
|
||||
RPROMPT='$(git_prompt_ahead)$(parse_git_dirty) $(branch_prompt)%{$reset_color%} %{$reset_color%}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue