Configuration for zsh

This commit is contained in:
Yan Pritzker 2011-11-22 19:02:36 -06:00
parent 5e851289e9
commit 0ebab432d3
4 changed files with 60 additions and 0 deletions

View File

@ -15,6 +15,18 @@ This project uses git submodules for some of its plugins. Please run:
To get all the current plugins. Over time, I plan to move all plugins into submodules.
Setup for ZSH
---
I am now using ZSH as my default shell because of its awesome globbing
and autocomplete features, nice colors, etc. This setup assumes you use
oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh)
Place this as the last line in your ~/.zshrc created by oh-my-zsh:
source ~/.dotfiles/zshrc
This setup reuses my bash aliases but provides some custom functions.
Setup for Bash
---
To set these up as your own (careful, don't overwrite your bash_profile unintentionally!):

View File

@ -10,3 +10,6 @@ fi
. ~/.dotfiles/bash_aliases
. ~/.dotfiles/bash_options
. ~/.dotfiles/bash_path
# RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

18
zsh_aliases Normal file
View File

@ -0,0 +1,18 @@
# Aliases that only make sense in zsh
# Functions
#
# (f)ind by (n)ame
# usage: fn foo
# to find all files containing 'foo' in the name, the grep adds a pretty highlight
fn() { ls **/*$1* | grep $1 }
# Global aliases
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias -g C='| wc -l'
alias -g H='| head'
alias -g L="| less"
alias -g N="| /dev/null"
alias -g S='| sort'

27
zshrc Normal file
View File

@ -0,0 +1,27 @@
# Configuration
source ~/.dotfiles/bash_aliases
source ~/.dotfiles/zsh_aliases
source ~/.dotfiles/bash_path
#
# Things I don't want to publish to github
source ~/.secrets
# Vim mode
bindkey -v
# Give me my bash style incremental search
bindkey '^R' history-incremental-search-backward
# Speed up git completion
# http://talkings.org/post/5236392664/zsh-and-slow-git-completion
__git_files () {
_wanted files expl 'local files' _files
}
# Always pushd when changing directory
setopt auto_pushd
# Fuzzy matching of completions for when you mistype them:
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric