Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
How to display "waiting to complete" dots
- X-seq: zsh-users 11565
- From: "Ian Langworth" <ian.langworth@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: How to display "waiting to complete" dots
- Date: Wed, 13 Jun 2007 13:53:35 -0700
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Ke76pyYU2T3NEBfur0V6t9Gg7y8P+7WWYKPdPoybKGKDQNrSadpRptBARTBWszxxfsfri0lx8FstGU6KgI+7lQR4C9waDjEvhpAMr4WHQ9RKHvG+FCdbYYAz/yuhIpCJTRzA5CHB435d0GP9ueWM44OzgMn06AHv/HsWRlXE2IY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ezyF3u0piizDaTNlci01GMa3XMGKXbsxO43obyNR2sXpL9X5fdFzNdO2Ua3405s/WT+HDyFM1Au15zGeqqndY8Jh6envplxdfmplyZaLEAyAadVAMl0UbgIACqmR9RG1D/7D3F0vdnwENHJKmw4wPGqsI3QsSiQ2FMMn7NyMdMc=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
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