Solved: ZSH tab completion painfully slow
First, I love zsh. It has a bunch of features that bash doesn’t so I’ve been using it as my main shell for about three years.
That said, it hasn’t been all great. Some time ago, I came across a major issue that almost made me stop using zsh. Basically, for sufficiently large projects, git tab completion was taking longer and longer. At first, it was a few seconds which, while annoying, wasn’t fatal. Then it got worse and worse. This morning, if I had a file named foo.html and I typed
git diff fo and hit tab, the command line would lock for up to 30 seconds, leaving me unable to do anything.
I had, in the past, spent some time searching and found a handful of pages in the zsh developer mailing lists discussing the problem as a known issue, but offering no solution. Some pointed to the way compinit recursively does things, others had other explanations, but no one offered a
Continue reading →