While writing a help file for a plugin, I started listing all the potential line number specifiers but then thought Why not just reference the Vim help? and wondered where it is. The closest is at *cmdline-ranges*
, though it has only some specifiers. So this help update addresses that, along with a few other things either side of that passage in cmdline.txt
, including some distinguising and corrective points.
E1050
in vim9.txt
, which goes into more detail.:h :write
, which has, “Write the whole buffer…”).,
versus ;
work differently in practice.)$
was “in the file”, which should be either “in the buffer” or could be omitted.%
was “the entire file”, which should be “the entire buffer”.'t
and 'T
:
{a-z}
, {A-Z0-9}
, and the many other marks to explain what is available.'T
line in that it looked messy going into the tags “column”, which is fixed. The “table” now has three distinct, non-overlapping, “columns”.'t
to 'x
is more consistent with usage elsewhere. For example, getpos()
in builtin.txt
uses 'x
.:'
is made :'x
and :'X
, which distinguishes it/them from the other new tags, outlined below.'<
and '>
especially may generate “aha” moments (e.g., :'<,'>
from using :
in a Visual mode is common, though perhaps not well understood?). There are nuances to these that make them worth spelling out too given their linewise operation.
*
, since it is another range synonym like %
, is included for completeness. It is covered later in detail, so a hotlink to :star
makes sense too.'x
/'X
have the :'
tag removed. (Although it could be retained, with the addition of the other '
tags, the :'
aggregated tag does not seem necessary.)'[
to '}
are added. Some are particularly useful, so awareness of them, and what they represent in a linewise context, is helpful. Corresponding tags are added for each too.\/
, \?
, and \&
are slightly reworded to, “most recent”, rather than, “previously used”, which is ambiguous. (Does “previously used” mean “the most recent”, “the penultimately most recent”, “any previous”, etc.?)/
, for example, /mypattern
from the cursor will find matches within the current line whereas :/mypattern/
finds mypattern
after the current line.:range-offset
was scant and questionable.
:,
and :;
, which are important distinctions.:range
list.https://github.com/vim/vim/pull/18278
(2 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@zeertzjq commented on this pull request.
> + 'x the line of the position of mark x *:'x* + (where x is any {a-z} mark) + 'X the line of the position of mark X *:'X* + (where X is any {A-Z0-9} mark, though + when X is in another buffer it cannot + be used in a range) + '[ the first line of the most recent *:'[* + change or yank + '] the last line of the most recent *:']* + change or yank + '< the first line of the most recently *:'<* + selected Visual area + '> the last line of the most recently *:'>* + selected Visual area + '' the line of the position before the *:''* + latest jump, or where the last "m'"/"m`" + command was given (though '' is 1 if it + isn't in the current buffer) + '" the line of the cursor position when *:'quote* + last exiting the buffer + '^ the line of the cursor position the *:'^* + last time Insert mode was stopped + '. the line of the cursor position when the *:'.* + buffer was last changed + '( the line of the first character of the *:'(* + current sentence + ') the line of the first character after *:')* + the end of the current sentence + '{ the first empty line before the *:'{* + paragraph containing the cursor + '} the first empty line after the *:'}* + paragraph containing the cursor
Why do the documentation of different marks have to be repeated here?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@kennypete commented on this pull request.
Explained, above, in detail. They are not "repeated" in the context of being line specifiers - there is no comprehensive list anywhere of them. It's useful to know what they are in the line specifier context, not just a 'jump to mark' context, where mark-motions
has them spread over many "pages", and in that context it is the specific position, rather than line, that's relevant.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
thanks, this is a nice summary.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I have made a few changes:
When the following legacy Vim script is sourced, it prints the line number and " + print": >
so I kept the original. (and it was a bit verbose).—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
that is a good goal. I appreciate making the examples self-contained and being able to source those directly from the help file.
It depends on how many changes this will contain. Reviewing 1000s of lines is exhausting, so I'd appreciate if you can group into smaller commits, each fixing some logical sections in the help file. Then you can also split up your description directly into the commit message and as such it does not get lost when I decide to merge each individual commit (instead of squashing all into a single commit).
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.