Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: up-line and down-line without history
- X-seq: zsh-users 16068
- From: Guido van Steen <gvsteen@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: up-line and down-line without history
- Date: Wed, 1 Jun 2011 08:17:07 -0700 (PDT)
- Cc: Bernhard Tittelbach <xro@xxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1306941427; bh=bn3cG1wAg8AffRxP37/AG6w+IR8tK40b9z1WkioT1F8=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=lbtas6CEhAiDSK+8Tv8vP4btuPeZL30/MmpEV/yAhz4vPACQxbZOvinaIQfdBO1zMV6R9JlfjOLTn/E5Anyph0traMK+UfL3wslyzBZi+F8n80/MuTABTUX0ofPtNv918X3n1zwNeAvAxrt5YCAH2eWYQwkm1K+G7MAWlBSTDj0=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=P10oOiRYu0y/MAmzVRDaIKyz33cz8i7NrQIM1+a/KNKuTnmmjP0/dwhGsIknL98d+eFsT9jaMpXW+SzN4e7TLFZfeP5eoN9biS19ImMZ5NGdv30qKoD7UCvBok+xj71WT4V1rOJJRkXGuTpaM84isJksXj8jioScCCswRfYOv54=;
- In-reply-to: <4DE65464.6080806@realraum.at>
- 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
Bernard, Thanks a lot! I will try this one as well!
Guido
--- On Wed, 1/6/11, Bernhard Tittelbach <xro@xxxxxxxxxxx> wrote:
> From: Bernhard Tittelbach <xro@xxxxxxxxxxx>
> Subject: Re: up-line and down-line without history
> To: zsh-users@xxxxxxx
> Date: Wednesday, 1 June, 2011, 10:01 PM
> On 2011-06-01 16:32, Bernhard
> Tittelbach wrote:
> > On 2011-06-01 09:45, Guido van Steen wrote:
> >> Dear List,
> >>
> >> I have been trying to find out how to "just"
> navigate through a multiline buffer.
> >>
> >> I know the "up-line-or-history" and
> "down-line-or-history" widgets. It seems
> >> to me that the "up-line" and "down-line" parts of
> these widgets do exactly
> >> what I want. So the problem is that I would like
> to avoid the "or-history" part.
> >>
> >> Are there a similar widgets that exclusively
> control the navigation of
> >> multiline buffers, i.e. without the side-effect of
> potentially navigating the
> >> history file?
> >>
> >> Or could/should I create my own widgets based on
> "up-line-or-history" and
> >> "down-line-or-history", in which I just override
> the "or-history" part?
> >
>
> as for writing it yourself, maybe, off the top of my head,
> something like this ??
>
> function up-line
> {
> local buflines chars_above chars_left
> buflines=(${(f)LBUFFER})
> chars_above="${#buflines[$#buflines-1]}"
> chars_left="${#buflines[$#buflines]}"
> [[ $chars_left -gt $chars_above ]] &&
> chars_above=$chars_left
> CURSOR=$((CURSOR-chars_above-1))
> }
> zle -N up-line && bindkey "^[[A" up-line
>
> > regards,
> > Bernhard
> >
>
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author