aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/cmdline.txt
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:31:31 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:31:31 +0000
commit9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch)
tree607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /runtime/doc/cmdline.txt
parent9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff)
parent3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff)
downloadrneovim-usermarks.tar.gz
rneovim-usermarks.tar.bz2
rneovim-usermarks.zip
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'runtime/doc/cmdline.txt')
-rw-r--r--runtime/doc/cmdline.txt58
1 files changed, 50 insertions, 8 deletions
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index 29eff75bfa..b4923b0d70 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -524,7 +524,6 @@ that see the '"' as part of their argument:
:cexpr (and the like)
:cdo (and the like)
:command
- :cscope (and the like)
:debug
:display
:echo (and the like)
@@ -566,7 +565,6 @@ followed by another Vim command:
:cdo
:cfdo
:command
- :cscope
:debug
:eval
:folddoopen
@@ -575,7 +573,6 @@ followed by another Vim command:
:global
:help
:helpgrep
- :lcscope
:ldo
:lfdo
:lhelpgrep
@@ -586,7 +583,6 @@ followed by another Vim command:
:python
:registers
:read !
- :scscope
:sign
:terminal
:vglobal
@@ -694,7 +690,9 @@ Line numbers may be specified with: *:range* *{address}*
'T position of mark T (uppercase); when the mark is in
another file it cannot be used in a range
/{pattern}[/] the next line where {pattern} matches *:/*
+ also see |:range-pattern| below
?{pattern}[?] the previous line where {pattern} matches *:?*
+ also see |:range-pattern| below
\/ the next line where the previously used search
pattern matches
\? the previous line where the previously used search
@@ -702,11 +700,49 @@ Line numbers may be specified with: *:range* *{address}*
\& the next line where the previously used substitute
pattern matches
+ *:range-offset*
Each may be followed (several times) by '+' or '-' and an optional number.
This number is added or subtracted from the preceding line number. If the
number is omitted, 1 is used. If there is nothing before the '+' or '-' then
the current line is used.
-
+ *:range-closed-fold*
+When a line number after the comma is in a closed fold it is adjusted to the
+last line of the fold, thus the whole fold is included.
+
+When a number is added this is done after the adjustment to the last line of
+the fold. This means these lines are additionally included in the range. For
+example: >
+ :3,4+2print
+On this text:
+ 1 one ~
+ 2 two ~
+ 3 three ~
+ 4 four FOLDED ~
+ 5 five FOLDED ~
+ 6 six ~
+ 7 seven ~
+ 8 eight ~
+Where lines four and five are a closed fold, ends up printing lines 3 to 7.
+The 7 comes from the "4" in the range, which is adjusted to the end of the
+closed fold, which is 5, and then the offset 2 is added.
+
+An example for subtracting (which isn't very useful): >
+ :2,4-1print
+On this text:
+ 1 one ~
+ 2 two ~
+ 3 three FOLDED~
+ 4 four FOLDED ~
+ 5 five FOLDED ~
+ 6 six FOLDED ~
+ 7 seven ~
+ 8 eight ~
+Where lines three to six are a closed fold, ends up printing lines 2 to 6.
+The 6 comes from the "4" in the range, which is adjusted to the end of the
+closed fold, which is 6, and then 1 is subtracted, then this is still in the
+closed fold and the last line of that fold is used, which is 6.
+
+ *:range-pattern*
The "/" and "?" after {pattern} are required to separate the pattern from
anything that follows.
@@ -762,9 +798,9 @@ always be swapped then.
Count and Range *N:*
-When giving a count before entering ":", this is translated into:
+When giving a count before entering ":", this is translated into: >
:.,.+(count - 1)
-In words: The 'count' lines at and after the cursor. Example: To delete
+In words: The "count" lines at and after the cursor. Example: To delete
three lines: >
3:d<CR> is translated into: .,.+2d<CR>
<
@@ -881,7 +917,7 @@ Note: these are typed literally, they are not special keys!
file name of the sourced file. *E498*
When executing a function, is replaced with the call stack,
as with <stack> (this is for backwards compatibility, using
- <stack> is preferred).
+ <stack> or <script> is preferred).
Note that filename-modifiers are useless when <sfile> is
not used inside a script.
*:<stack>* *<stack>*
@@ -891,6 +927,12 @@ Note: these are typed literally, they are not special keys!
".." in between items. E.g.:
"function {function-name1}[{lnum}]..{function-name2}[{lnum}]"
If there is no call stack you get error *E489* .
+ *:<script>* *<script>*
+ <script> When executing a `:source` command, is replaced with the file
+ name of the sourced file. When executing a function, is
+ replaced with the file name of the script where it is
+ defined.
+ If the file name cannot be determined you get error *E1274* .
*:<slnum>* *<slnum>*
<slnum> When executing a `:source` command, is replaced with the
line number. *E842*