Skip to content

Commit

Permalink
improving zsh config, specifically with regards to completion
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Jul 8, 2008
1 parent e97d769 commit a7ea2ef
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 48 deletions.
12 changes: 6 additions & 6 deletions bash/aliases
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

# cd

alias up='cd ..'
alias ..='cd ..'
function c { cd ~/code/$1; }


# ls

alias ls="ls -F"
alias l="ls -lAh"
alias ll="ls -l"
alias la='ls -A'
Expand All @@ -17,11 +17,11 @@ alias la='ls -A'
alias gl='git pull'
alias gp='git push'
alias gd='git diff'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gc='git commit'
alias gca='git commit -a'
alias gco='git checkout'
alias gb='git branch -v'
alias gs='git status -v'
alias gb='git branch'
alias gs='git status'


# rails
Expand Down
42 changes: 1 addition & 41 deletions zsh/aliases
Original file line number Diff line number Diff line change
@@ -1,45 +1,5 @@

# cd

alias ..='cd ..'
function c { cd ~/code/$1; }


# ls

alias l="ls -lAh"
alias ll="ls -l"
alias la='ls -A'


# git

alias gl='git pull'
alias gp='git push'
alias gd='git diff'
alias gc='git commit'
alias gca='git commit -a'
alias gco='git checkout'
alias gb='git branch'
alias gs='git status'


# rails

alias sc='script/console'
alias ss='script/server'
alias a='autotest -rails'
alias tlog='tail -f log/development.log'
alias scaffold='script/generate nifty_scaffold'
alias migrate='rake db:migrate db:test:clone'


# misc

alias reload='. ~/.bash_profile'

. ~/.bash/aliases

# commands starting with % or $ for pasting from web

alias %=' '
alias \$=' '
18 changes: 18 additions & 0 deletions zsh/completion
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
autoload -U compinit
compinit

# matches case insensitive for lowercase
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'

# pasting with tabs doesn't perform completion
zstyle ':completion:*' insert-tab pending

# see aliases file for c function definition
compdef '_files -W ~/code -/' c

# enables verbose completion
verbose_completion() {
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*' group-name ''
}
5 changes: 4 additions & 1 deletion zsh/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ PS1='%3~$(git_branch_for_prompt)%# '
EDITOR='mate -w'
PATH="~/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/git/bin:$PATH"
MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
cdpath=(. ~/code)

cdpath=($cdpath ~/code)

HISTFILE=~/.zsh_history
HISTSIZE=1000
SAVEHIST=1000

setopt NO_BG_NICE # don't nice background tasks
setopt NO_HUP
setopt NO_LIST_BEEP
setopt LOCAL_OPTIONS # allow functions to have local options
setopt LOCAL_TRAPS # allow functions to have local traps
setopt HIST_VERIFY
setopt SHARE_HISTORY # share history between sessions ???
setopt EXTENDED_HISTORY # add timestamps to history
setopt PROMPT_SUBST
setopt CORRECT
setopt COMPLETE_IN_WORD

setopt APPEND_HISTORY # adds history
setopt INC_APPEND_HISTORY SHARE_HISTORY # adds history incrementally and share it across sessions
Expand Down

0 comments on commit a7ea2ef

Please sign in to comment.