Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: truncating string in .zprofile
- X-seq: zsh-users 17721
- From: Eric Smith <Eric.Smith@xxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: truncating string in .zprofile
- Date: Wed, 20 Mar 2013 21:54:48 +0100
- In-reply-to: <20130320204528.GC89285@phisen.local>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <mailbox-13443-1363803840-947330@pepper.0.0.200> <20130320194102.GB89285@phisen.local> <mailbox-7940-1363810632-852297@pepper.0.0.200> <20130320204528.GC89285@phisen.local>
--
Best regards,
Eric Smith
Mobile: 00 31 6 455 09313 - Tel Wageningen: +31 317 728888
Paul Hoffman wrote on Wed-20-Mar 13 9:45PM
> On Wed, Mar 20, 2013 at 09:17:56PM +0100, Eric Smith wrote:
> > Yummy!
>
> Correcting myself:
>
> preexec() {
> print -Pn "\033k\033\134\033k[${1[1,30]}]\033\134"
> }
>
Funny, I did not even register those double quotes, just saw the
extra set of braces and then kicked myself, just like a solution
to many perl issues when you need an extra layer of eval.
I did this -
preexec () { print -Pn
"\033k\033\134\033k[${1[1,12]}..${1[-6,$]}]\033\134" }
How would I do arbitrary string searching and replacement in the `$1'?
Like to grab the top level domain from a URL or whatever.
Currently my window captions look like this:
[s asteri..vvvvv -c] 1 [vim .screenc..aptio] 4 [vim food..2013.txt]
Nice, but still a bit lame.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author