From: Bernhard Tittelbach <xro@realraum.at>
To: zsh-workers@zsh.org
Subject: Re: Behaviour of {beginning,end}-of-buffer-or-history
Date: Thu, 02 Jun 2011 05:04:04 +0200 [thread overview]
Message-ID: <4DE6FDA4.6060705@realraum.at> (raw)
In-Reply-To: <110601192206.ZM14271@torch.brasslantern.com>
On 2011-06-02 04:22, Bart Schaefer wrote:
> On Jun 1, 9:57pm, Bernhard Tittelbach wrote:
[...]
Thanks ! :)
>
> } Jumping to the beginning/end of a line in a multi-line buffer
> } is just an extra my function does, and not somewhere I think
> } {beginning,end}-of-buffer-or-history
> } should do (it's name does not imply any such functionality :)
>
> If you care to travel back in time 20 years or so you can take that
> up with Paul Falstad. :-)
If I learn how to do that, I'm sure that will be the first thing I'll
use it for ;-)
>
> Meanwhile ... I think there's an easier way than whatever that is
> you're doing with buflines and cur_array ...
>
> beginning-or-end-of-somewhere() {
> local hno=$HISTNO
> zle .${WIDGET:s/somewhere/line-hist/} "$@"
> if (( HISTNO != hno )); then
> zle .${WIDGET:s/somewhere/buffer-or-history/} "$@"
> fi
> }
> zle -N beginning-of-somewhere beginning-or-end-of-somewhere
> zle -N end-of-somewhere beginning-or-end-of-somewhere
>
Mhh, just when I got used to jumping to the beginning/end of a
multi-line buffer with a double keypress of HOME/END ...
But it certainly is shorter, faster and more readable ;-)
and on single-line buffers completely equivalent to what my code did
which is obviously going to be the predominant use-case.
Thanks again,
Bernhard
next prev parent reply other threads:[~2011-06-02 3:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-01 19:57 Bernhard Tittelbach
2011-06-02 2:22 ` Bart Schaefer
2011-06-02 3:04 ` Bernhard Tittelbach [this message]
2011-06-02 14:25 ` Bart Schaefer
2011-06-02 16:02 ` Bernhard Tittelbach
-- strict thread matches above, loose matches on Subject: below --
2011-06-01 19:43 Bernhard Tittelbach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DE6FDA4.6060705@realraum.at \
--to=xro@realraum.at \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).