Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: howto correct 7etc to /etc ?
- X-seq: zsh-users 8043
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: ZSH User List <zsh-users@xxxxxxxxxx>
- Subject: Re: howto correct 7etc to /etc ?
- Date: Wed, 6 Oct 2004 19:50:29 -0700 (PDT)
- Cc: Andy Spiegl <zsh.Andy@xxxxxxxxx>
- In-reply-to: <20041006213603.GA14017@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20041005235836.GA8546@xxxxxxxxx> <Pine.LNX.4.61.0410060842190.28099@xxxxxxxxxxxxxxxxxx> <20041006213603.GA14017@xxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
On Wed, 6 Oct 2004, Andy Spiegl wrote:
> Hm, would it also possible to expand this mechanism to also correct this
> more complicated example:
> $ cd /etc7apache<TAB>
Probably something like this:
function _7slash {
local noseven=${words[CURRENT]//7/\/}
if [[ $words[CURRENT] != $noseven ]]
then
compadd -U -X 'Correct 7 to /' -f $noseven
fi
}
There's all sorts of room for improvement here ... it could look only at
the part to the left of the cursor depending on styles or the setting of
the complete_in_word option; etc.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author