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

Re: howto correct 7etc to /etc ?



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