Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting serious lag when doing auto complete for rake. I have a 2011 MBP with an SSD and I'm still getting something like 3 - 5 second lag when attempting to autocomplete.

Thanks for your help!

.zshrc:

###OHMYZSH
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="lambda"
COMPLETION_WAITING_DOTS="true"
plugins=(node git bundler rails rails3 ruby autojump npm bower)
source $ZSH/oh-my-zsh.sh

###PATH
export PATH=/usr/local/sbin:/usr/local/bin/rbenv:/usr/local/bin:/usr/local/bin/ctags:/usr/local/postgres:/Users/chance/.rbenv/shims:/usr/local/share/zsh:$PATH
export PATH=$PATH:$HOME/.npm # Add npm modules to PATH for scripting
export PATH=$PATH:$HOME/.npm/bin # Add npm modules to PATH for scripting
export PATH=$PATH:$HOME/.npm/lib # Add npm modules to PATH for scripting


###ALIASES
  alias pg_start="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
  alias pg_stop="pg_ctl -D /usr/local/var/postgres stop -s -m fast"
  alias show_hidden='defaults write com.apple.finder AppleShowAllFiles TRUE & killall Finder'
  alias hide_hidden='defaults write com.apple.finder AppleShowAllFiles FALSE & killall Finder'
  alias mw='mocha -w -s 20ms -t 1000 --reporter Spec --growl'


###PG
export PGDATA='/usr/local/pgsql/data'


###BREW
if [ -f `brew --prefix`/etc/autojump ]; then
  . `brew --prefix`/etc/autojump
fi

###HEROKU
export PATH="/usr/local/heroku/bin:$PATH"

###NPM
COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
export COMP_WORDBREAKS

if type complete &>/dev/null; then
  _npm_completion () {
    local si="$IFS"
    IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
                           COMP_LINE="$COMP_LINE" \
                           COMP_POINT="$COMP_POINT" \
                           npm completion -- "${COMP_WORDS[@]}" \
                           2>/dev/null)) || return $?
    IFS="$si"
  }
  complete -F _npm_completion npm
elif type compdef &>/dev/null; then
  _npm_completion() {
    si=$IFS
    compadd -- $(COMP_CWORD=$((CURRENT-1)) \
                 COMP_LINE=$BUFFER \
                 COMP_POINT=0 \
                 npm completion -- "${words[@]}" \
                 2>/dev/null)
    IFS=$si
  }
  compdef _npm_completion npm
elif type compctl &>/dev/null; then
  _npm_completion () {
    local cword line point words si
    read -Ac words
    read -cn cword
    let cword-=1
    read -l line
    read -ln point
    si="$IFS"
    IFS=$'\n' reply=($(COMP_CWORD="$cword" \
                       COMP_LINE="$line" \
                       COMP_POINT="$point" \
                       npm completion -- "${words[@]}" \
                       2>/dev/null)) || return $?
    IFS="$si"
  }
  compctl -K _npm_completion npm
fi
###-end-npm-completion-###
share|improve this question
    
probably the lag results from a timeout and not really sluggishness? – Lorenzo Von Matterhorn Sep 25 '13 at 18:36
    
@LorenzoVonMatterhorn Maybe, but it gives me the options. Is there anyway to debug that? – Chance Sep 25 '13 at 18:41
up vote 4 down vote accepted

I randomly came across this question as I was looking for something unrelated, but it turns out that just last night, I re-packaged an old script into an oh-my-zsh plugin to cache rake suggestions and make rake autocompletion much faster:

https://github.com/KevinBongart/rake-fast

Hope this helps!

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .