Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Mimicking tcsh line-editing behavior
- X-seq: zsh-users 14216
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: Mimicking tcsh line-editing behavior
- Date: Thu, 2 Jul 2009 22:13:22 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=AyHrh5bo6sCa/eCdpzGnaFPomd6i6U2qgWmQfhqCXOw=; b=tQI5HR+QFehPffU4vXqjzqKJUh33gLg5uLIKSYWas6RXfRyiaymAEW/1ytEsu5uuiS UzHW2as15yk8TXQkXTqM7ckfjUF79kvnr+nApy/4aCKvA7dUZbq8kvfJc5QC+F0H/GMD UgmY/8/6KqoNmO26FkctUCq1ySo05bDkqyl1s=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=T4amt7Z9TLiqsbI9Xrv4WGTDZVArbHn8wDTr3nWTa5Aexj9QkRq8UnAujSb+1uJQmc j6LNn+K9Mxds+Ka/j0FJkP9hONKFOLdtNfBR2ZcjAQHwWGiaPB7PGzlr744vGFfqeaJG VUzSMv7eblsD7tWr+jPEb3+wrsS+mCNDaXBtE=
- In-reply-to: <alpine.LNX.2.00.0907021554160.28404@averatec>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <198303.88532.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <237967ef0907021250x5b621333m875aff26fa8aeaac@xxxxxxxxxxxxxx> <alpine.LNX.2.00.0907021554160.28404@averatec>
2009/7/2 Benjamin R. Haskell <zsh@xxxxxxxxxx>:
> On Thu, 2 Jul 2009, Mikael Magnusson wrote:
>
>> On 2009/7/2 Rhyme Tan wrote:
>> > My default shell is tcsh. In tcsh I can use alt(meta)-backspace, alt-F or
>> > alt-B to delete, or move forward or backward through a path.
>> >
>> > For example I type:
>> >
>> > ls /An/Example/of/a/Path/Name/
>> >
>> > To delete Path/Name/, I simply hold down the alt key and press backspace
>> > twice (alt-backspace x2). This will leave me with the path
>> > "/An/Example/of/a/". I cannot do this in zsh because pressing
>> > alt-backspace will delete the whole path (that is,
>> > "/An/Example/of/a/Path/Name/"). Is there some magic config option
>> > I can pass to zsh to duplicate the behavior of alt-backspace, -F, or -B) in
>> > tcsh?
>> >
>> > Thanks.
>>
>> This was posted here some time ago (months, years, who knows?)
This seems to be an early version
http://www.zsh.org/mla/users/2005/msg01312.html
>> and I
>> have used it since:
>>
>> _my_extended_wordchars='*?_-.[]~=&;!#$%^(){}<>:@,\\';
>>
>> [... trimmed ...]
>
> Mikael -- that seems like overkill... Is there something particularly
> useful about all of the "\\"- and quoted-or-not logic?
>
> I get roughly what the OP was asking for by simply setting:
>
> WORDCHARS='*?_-.[]~&;!#$%^(){}<>'
>
> in my ~/.zshenv.
>
> The important bit is that '/' is not present in my preferred WORDCHARS
> list, but it is in the default list. ('.' is another one that seems to be
> commonly omitted, in order to backspace to the '.'s in domain names/IP
> addresses or file.extensions.)
Well, I still like to delete the whole word occasionally, so having
both is useful. Just removing the / doesn't seem to handle paths with
spaces either, so /foobar/with\ spaces/in\ it gives
/foobar/with\ spaces/in\
/foobar/with\ spaces
/foobar/with\
which is very annoying when directories have 6 spaces in them :). As
for being overkill, I have the whole thing I pasted in a separate file
so it doesn't clutter up my .zshrc
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author