Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

How to display "waiting to complete" dots



I've found that completion on NFS can take a while. Vim has this neat
feature that shows dots while it's waiting to complete a filename, so
I spent some time to figure out how to make that happen with Zsh.

With the following snippet, when you hit Tab, you'll see dots for a
split-second before the completion finishes:

-------------------------------------------------------------
expand-or-complete-with-dots() {
echo -n "..."
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
-------------------------------------------------------------

I haven't tested this fully, but I love it already.

Extra: If you want your dots to be fire-truck red, instead do echo -n
"\e[31m...\e[0m"

--
Ian Langworth



Messages sorted by: Reverse Date, Date, Thread, Author