Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: globbing
- X-seq: zsh-users 4113
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Borsenkow Andrej <Andrej.Borsenkow@xxxxxxxxxxxxxx>, Will Yardley <william@xxxxxxxxxxxxxxx>
- Subject: Re: globbing
- Date: Sat, 11 Aug 2001 21:23:58 +0000
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <3B7512B9.8010104@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20010810002007.A4701@xxxxxxxxxxxxxxx> <000401c1217c$38454690$21c9ca95@xxxxxxxxxxxxxx> <20010810123418.H4701@xxxxxxxxxxxxxxx> <3B7512B9.8010104@xxxxxxxxxxxxxx>
On Aug 11, 3:10pm, Borsenkow Andrej wrote:
}
} > in zsh i can only expand it if i put a space, and then the result looks
} > like:
} > aura% cd /usr/local/ bin/
} >
} > complete_in_word doesn't do this (as was mentioned the last time someone
} > brought this up on the list). i find the bash way much more intuitive even
} > if the zsh way is more 'correct'.
}
} You have to use expand-or-complete-prefix instead of expand-or-complete
} (or complete-word), like
}
} bindkey '^I' expand-or-complete-prefix
} setopt completeinword
}
} But then your first problem is back - there is no complete-prefix widget.
You can, however, roll your own (but not in 3.0.x):
bash-complete () {
emulate -L zsh
if [[ $RBUFFER = (|[[:space:]\;\&\|\>]*) ]]
then
zle complete-word # Completing at end of word is not special
else
setopt noautomenu # Cannot menu-complete the prefix, sorry
RBUFFER[1]=" $RBUFFER[1]"
zle complete-word
RBUFFER[1,2]=$RBUFFER[2]
if [[ $LBUFFER[-1] = $RBUFFER[1] ]]
then
LBUFFER[-1]='' # Suppress doubled slashes, for example
fi
fi
}
zle -N bash-complete
bindkey '\t' bash-complete
This could, I suppose, get added to the collection of bash-alike functions
that PWS has created. It does appear to work with `setopt bashautolist'.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author