Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: vi mode cursor position
- X-seq: zsh-users 24067
- From: Christopher Paul <Christopher.Paul@xxxxxxxxxxxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: RE: vi mode cursor position
- Date: Mon, 15 Jul 2019 22:08:22 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=hitachivantara.com;dmarc=pass action=none header.from=hitachivantara.com;dkim=pass header.d=hitachivantara.com;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h35/k32agSVGaQqXbs38ocP5T6fvTLPBmAZCG29tCz4=; b=XJhxrduDVe59CUo2QQI6bGNu3GSOiqHid393nxwf5x2T10pwb6NBlc+OJSUkRGNGHusw8tIHI6ycHmDCa5jFBp9yBUm02m/7znEqXA4QMooEuB2l21HmONqFrHCOaxq5e8Hem95jp353NUK7ZH6Gf62kK14L9E6pve+/pTep63CzhI4jMNWPq1xYy8hDsxTXOxdxdAePAfXtEEmxZsSThzWwGMFjB+PIxWSdpNSr+BHjZp1nNooTg7sgHFKxVZvUpMK0+HM3EmCL6oXt1L0i6GyPOQg+gcULhOCk+eyZhxshID/cZQsqJb2ihKtPN4MSbE9WImxPqG+si8Jgh1LZ3w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MH2XpxI0Vv6sxtGheTU8P6cjyHiQGdvk7GT62pCSsuYiJ0lxlKlBEWhJ3Ex5F2TYxwBI4gf1g5RSTCWo7gyx7cNbIE7Vs9m6bNOkTSkIEFomSaLtE3egXQdKLvkxq3x2IEexy8wpUY24iH4oG4tvcnXoCWIhTj4yiDCi/3RQBKXnFuWpAQZ6qQqddsL5Z0EMkmFJVkKXi5C8R/zCzt3m80Wn142Yeg/Hnhi9k+eAkX1eCiygKm4btjW8qEPpQsFAzaZwN3bYKgpUeTOOGG7VMARIbicPvMehjP6StaggaZENDe9ceG1HeNCfIxsSTQNU9hXEmzMtIcn0o6/hQP/zeg==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Christopher.Paul@xxxxxxxxxxxxxxxxxx;
- Cc: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hitachidatasystems.onmicrosoft.com; s=selector1-hitachidatasystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h35/k32agSVGaQqXbs38ocP5T6fvTLPBmAZCG29tCz4=; b=uSAR6st8LbN6zkU9CIh71+PPXkW1+TX1mdhL56XezRPX4X3AhoIAvVod01gyWi2hQcuQP3iZEeXxeYLkuheKl28DpXQe4B7rcCiqLsBqg4xvjF4e1QtM2dOyaUQeSH4MNblF3z8JECWrdpa9TB6JS4Y1q4FMLZGeZzJZ9Z8AAjs=
- In-reply-to: <41960-1563009868.475157@HUWd.vdv5.55oG>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <MWHPR08MB2448C2BDCB0DDC87EDADBE23EDF30@MWHPR08MB2448.namprd08.prod.outlook.com> <41960-1563009868.475157@HUWd.vdv5.55oG>
- Thread-index: AdU4QvR0qdTvR8TjQ6KMDZBOPZqKsABGdBoAAH8d4RA=
- Thread-topic: vi mode cursor position
Oliver Kiddle wrote:
> By default, k is bound to up-line-or-history.
> There are alternatives that differ in terms of the cursor position. For
> example:
>
> bindkey -a k history-beginning-search-backward
Thanks! This seems to work for me.
> However that may break other things like moving the cursor in a multi-line
> buffer so you may want to use a custom widget that does something like:
Hmm; I guess I'll know about that once I see it, but testing a multi-line buffer seems to work fine. I tested a multi-line buffer with:
echo "now is the time "\
> "for all good men"
> if [[ $LBUFFER == *$'\n'* ]]; then
> zle .up-line
> else
> zle .history-beginning-search-backward
> fi
I put this in my .zshrc file and it didn't seem to change anything.
Thanks again, Oliver, I really appreciate your response.
CP
Messages sorted by:
Reverse Date,
Date,
Thread,
Author