zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Documentation of $MARK and "vi-mode operators"
Date: Sat, 02 Sep 2023 03:22:48 +0200	[thread overview]
Message-ID: <61022-1693617768.894419@vZ1Y.btab.uAFY> (raw)
In-Reply-To: <CAH+w=7YSMdPxhZjD=AO84DbrnA-gcB7DEuCsY2K_w6+u_17vPg@mail.gmail.com>

On 27 Aug, Bart Schaefer wrote:
> A quick question given that I am not usually a "bindkey -v" user --
> the doc says:
>
> MARK (integer)
>      Like CURSOR, but for the mark.  With vi-mode operators that wait
>      for a movement command to select a region of text, setting MARK
>      allows the selection to extend in both directions from the initial
>      cursor position.
>
> Are there any "vi-mode operators that wait for a movement command to
> select a region" other than visual-mode and visual-line-mode ?

The vi-mode operators that wait for a movement command are things like
vi-change, vi-delete and vi-yank.

For examples of widgets that set MARK to select a region of text, search
for "Text Objects" in the documentation - that's also the term used in
vim documentation. Examples include select-a-shell-word and
select-in-word. So, e.g. diw will delete the current word that the
cursor is on regardless of whether the cursor is at the beginning,
middle or end of the word. But you can also use iw from visual mode to
select a word. Zsh includes some text objects written in shell code too.

> Both of which automatically set the mark upon entry, as far as I can
> tell, unless it is already set?

Yes, for the common case they need to initialise MARK.

Oliver


  reply	other threads:[~2023-09-02  1:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-27 21:08 Bart Schaefer
2023-09-02  1:22 ` Oliver Kiddle [this message]
2023-09-02 22:21   ` Bart Schaefer

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=61022-1693617768.894419@vZ1Y.btab.uAFY \
    --to=opk@zsh.org \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@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).