Skip to content
forked from neovim/neovim

Commit

Permalink
fix(docs): vimdoc syntax errors
Browse files Browse the repository at this point in the history
Since neovim/tree-sitter-vimdoc#97
the many cases of *.foo cause parser errors. But even before that, these
were erroneously highlighted as (argument), so fixing them is good.
  • Loading branch information
justinmk committed Jun 22, 2023
1 parent 634f6eb commit c0dd7ed
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 106 deletions.
20 changes: 10 additions & 10 deletions runtime/doc/autocmd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For a basic explanation, see section |40.3| in the user manual.
You can specify commands to be executed automatically when reading or writing
a file, when entering or leaving a buffer or window, and when exiting Vim.
For example, you can create an autocommand to set the 'cindent' option for
files matching *.c. You can also use autocommands to implement advanced
files matching `*.c`. You can also use autocommands to implement advanced
features, such as editing compressed files (see |gzip-example|). The usual
place to put autocommands is in your vimrc file.

Expand Down Expand Up @@ -197,7 +197,7 @@ For READING FILES there are four kinds of events possible:
Vim uses only one of these four kinds when reading a file. The "Pre" and
"Post" events are both triggered, before and after reading the file.

Note that the autocommands for the *ReadPre events and all the Filter events
Note that the autocommands for the "*ReadPre" events and all the Filter events
are not allowed to change the current buffer (you will get an error message if
this happens). This is to prevent the file to be read into the wrong buffer.

Expand Down Expand Up @@ -1001,7 +1001,7 @@ TextChangedT After a change was made to the text in the
*TextYankPost*
TextYankPost Just after a |yank| or |deleting| command, but not
if the black hole register |quote_| is used nor
for |setreg()|. Pattern must be *.
for |setreg()|. Pattern must be "*".
Sets these |v:event| keys:
inclusive
operator
Expand Down Expand Up @@ -1417,24 +1417,24 @@ When there is a matching "*Cmd" autocommand, it is assumed it will do the
writing. No further writing is done and the other events are not triggered.
|Cmd-event|

Note that the *WritePost commands should undo any changes to the buffer that
were caused by the *WritePre commands; otherwise, writing the file will have
Note that the "*WritePost" commands should undo any changes to the buffer that
were caused by the "*WritePre" commands; otherwise, writing the file will have
the side effect of changing the buffer.

Before executing the autocommands, the buffer from which the lines are to be
written temporarily becomes the current buffer. Unless the autocommands
change the current buffer or delete the previously current buffer, the
previously current buffer is made the current buffer again.

The *WritePre and *AppendPre autocommands must not delete the buffer from
The "*WritePre" and "*AppendPre" autocommands must not delete the buffer from
which the lines are to be written.

The '[ and '] marks have a special position:
- Before the *ReadPre event the '[ mark is set to the line just above where
- Before the "*ReadPre" event the '[ mark is set to the line just above where
the new lines will be inserted.
- Before the *ReadPost event the '[ mark is set to the first line that was
- Before the "*ReadPost" event the '[ mark is set to the first line that was
just read, the '] mark to the last line.
- Before executing the *WriteCmd, *WritePre and *AppendPre autocommands the '[
- Before executing the "*WriteCmd", "*WritePre" and "*AppendPre" autocommands the '[
mark is set to the first line that will be written, the '] mark to the last
line.
Careful: '[ and '] change when using commands that change the buffer.
Expand Down Expand Up @@ -1542,7 +1542,7 @@ To read a skeleton (template) file when opening a new file: >
:autocmd BufNewFile *.h 0r ~/vim/skeleton.h
:autocmd BufNewFile *.java 0r ~/vim/skeleton.java
To insert the current date and time in a *.html file when writing it: >
To insert the current date and time in a "*.html" file when writing it: >
:autocmd BufWritePre,FileWritePre *.html ks|call LastMod()|'s
:fun LastMod()
Expand Down
2 changes: 1 addition & 1 deletion runtime/doc/eval.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ List An ordered sequence of items, see |List| for details.

Dictionary An associative, unordered array: Each entry has a key and a
value. |Dictionary|
Examples:
Examples: >
{"blue": "#0000ff", "red": "#ff0000"}
#{blue: "#0000ff", red: "#ff0000"}
Expand Down
66 changes: 33 additions & 33 deletions runtime/doc/filetype.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ you can either set the 'filetype' option manually, or add a modeline to your
file. Example, for an IDL file use the command: >
:set filetype=idl
or add this |modeline| to the file:
/* vim: set filetype=idl : */ ~

or add this |modeline| to the file: >
/* vim: set filetype=idl : */
<
*:filetype-plugin-on*
You can enable loading the plugin files for specific file types with: >
:filetype plugin on
Expand Down Expand Up @@ -136,38 +136,38 @@ what kind of file it is. This doesn't always work. A number of global
variables can be used to overrule the filetype used for certain extensions:

file name variable ~
*.asa g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax|
*.asm g:asmsyntax |ft-asm-syntax|
*.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
*.bas g:filetype_bas |ft-basic-syntax|
*.cfg g:filetype_cfg
*.cls g:filetype_cls
*.csh g:filetype_csh |ft-csh-syntax|
*.dat g:filetype_dat
*.frm g:filetype_frm |ft-form-syntax|
*.fs g:filetype_fs |ft-forth-syntax|
*.i g:filetype_i |ft-progress-syntax|
*.inc g:filetype_inc
*.lsl g:filetype_lsl
*.m g:filetype_m |ft-mathematica-syntax|
*.mod g:filetype_mod
*.p g:filetype_p |ft-pascal-syntax|
*.pl g:filetype_pl
*.pp g:filetype_pp |ft-pascal-syntax|
*.prg g:filetype_prg
*.r g:filetype_r
*.sig g:filetype_sig
*.sql g:filetype_sql |ft-sql-syntax|
*.src g:filetype_src
*.sys g:filetype_sys
*.sh g:bash_is_sh |ft-sh-syntax|
*.tex g:tex_flavor |ft-tex-plugin|
*.typ g:filetype_typ
*.w g:filetype_w |ft-cweb-syntax|
`*.asa` g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax|
`*.asm` g:asmsyntax |ft-asm-syntax|
`*.asp` g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
`*.bas` g:filetype_bas |ft-basic-syntax|
`*.cfg` g:filetype_cfg
`*.cls` g:filetype_cls
`*.csh` g:filetype_csh |ft-csh-syntax|
`*.dat` g:filetype_dat
`*.frm` g:filetype_frm |ft-form-syntax|
`*.fs` g:filetype_fs |ft-forth-syntax|
`*.i` g:filetype_i |ft-progress-syntax|
`*.inc` g:filetype_inc
`*.lsl` g:filetype_lsl
`*.m` g:filetype_m |ft-mathematica-syntax|
`*.mod` g:filetype_mod
`*.p` g:filetype_p |ft-pascal-syntax|
`*.pl` g:filetype_pl
`*.pp` g:filetype_pp |ft-pascal-syntax|
`*.prg` g:filetype_prg
`*.r` g:filetype_r
`*.sig` g:filetype_sig
`*.sql` g:filetype_sql |ft-sql-syntax|
`*.src` g:filetype_src
`*.sys` g:filetype_sys
`*.sh` g:bash_is_sh |ft-sh-syntax|
`*.tex` g:tex_flavor |ft-tex-plugin|
`*.typ` g:filetype_typ
`*.w` g:filetype_w |ft-cweb-syntax|

For a few filetypes the global variable is used only when the filetype could
not be detected:
*.r g:filetype_r |ft-rexx-syntax|
`*.r` g:filetype_r |ft-rexx-syntax|

*filetype-ignore*
To avoid that certain files are being inspected, the g:ft_ignore_pat variable
Expand Down Expand Up @@ -881,7 +881,7 @@ file: |ft_sql.txt|.

TEX *ft-tex-plugin* *g:tex_flavor*

If the first line of a *.tex file has the form >
If the first line of a `*.tex` file has the form >
%&<format>
then this determined the file type: plaintex (for plain TeX), context (for
ConTeXt), or tex (for LaTeX). Otherwise, the file is searched for keywords to
Expand Down
12 changes: 6 additions & 6 deletions runtime/doc/options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'completeslash'* *'csl'*
'completeslash' 'csl' string (default: "")
local to buffer
{only for MS-Windows}
only for MS-Windows
When this option is set it overrules 'shellslash' for completion:
- When this option is set to "slash", a forward slash is used for path
completion in insert mode. This is useful when editing HTML tag, or
Expand Down Expand Up @@ -3741,7 +3741,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'linespace'* *'lsp'*
'linespace' 'lsp' number (default 0)
global
{only in the GUI}
only in the GUI
Number of pixel lines inserted between characters. Useful if the font
uses the full character cell height, making lines touch each other.
When non-zero there is room for underlining.
Expand Down Expand Up @@ -4187,7 +4187,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'mousehide'* *'mh'* *'nomousehide'* *'nomh'*
'mousehide' 'mh' boolean (default on)
global
{only works in the GUI}
only in the GUI
When on, the mouse pointer is hidden when characters are typed.
The mouse pointer is restored when the mouse is moved.

Expand Down Expand Up @@ -4426,7 +4426,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'opendevice'* *'odev'* *'noopendevice'* *'noodev'*
'opendevice' 'odev' boolean (default off)
global
{only for Windows}
only for Windows
Enable reading and writing from devices. This may get Vim stuck on a
device that can be opened but doesn't actually do the I/O. Therefore
it is off by default.
Expand Down Expand Up @@ -5323,7 +5323,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'shellslash'* *'ssl'* *'noshellslash'* *'nossl'*
'shellslash' 'ssl' boolean (default off)
global
{only for MS-Windows}
only for MS-Windows
When set, a forward slash is used when expanding file names. This is
useful when a Unix-like shell is used instead of cmd.exe. Backward
slashes can still be typed, but they are changed to forward slashes by
Expand Down Expand Up @@ -7054,7 +7054,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'winaltkeys'* *'wak'*
'winaltkeys' 'wak' string (default "menu")
global
{only used in Win32}
only used in Win32
Some GUI versions allow the access to menu entries by using the ALT
key in combination with a character that appears underlined in the
menu. This conflicts with the use of the ALT key for mappings and
Expand Down
10 changes: 3 additions & 7 deletions runtime/doc/pattern.txt
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,6 @@ after: \v \m \M \V matches ~
\\ \\ \\ \\ literal backslash
\{ { { { literal curly brace

{only Vim supports \m, \M, \v and \V}

If you want to you can make a pattern immune to the 'magic' option being set
or not by putting "\m" or "\M" at the start of the pattern.

Expand All @@ -455,7 +453,7 @@ More explanation and examples below, follow the links. *E64* *E871*
\{n} \{n} n exactly
\{n,} \{n,} at least n as many as possible
\{,m} \{,m} 0 to m as many as possible
\{} \{} 0 or more as many as possible (same as *)
\{} \{} 0 or more as many as possible (same as "*")

|/\{-| \{-n,m} \{-n,m} n to m as few as possible
\{-n} \{-n} n exactly
Expand Down Expand Up @@ -633,7 +631,7 @@ overview.
\{n} Matches n of the preceding atom
\{n,} Matches at least n of the preceding atom, as many as possible
\{,m} Matches 0 to m of the preceding atom, as many as possible
\{} Matches 0 or more of the preceding atom, as many as possible (like *)
\{} Matches 0 or more of the preceding atom, as many as possible (like "*")
*/\{-*
\{-n,m} matches n to m of the preceding atom, as few as possible
\{-n} matches n of the preceding atom
Expand Down Expand Up @@ -1256,7 +1254,6 @@ letters only.
When "\c" appears anywhere in the pattern, the whole pattern is handled like
'ignorecase' is on. The actual value of 'ignorecase' and 'smartcase' is
ignored. "\C" does the opposite: Force matching case for the whole pattern.
{only Vim supports \c and \C}
Note that 'ignorecase', "\c" and "\C" are not used for the character classes.

Examples:
Expand Down Expand Up @@ -1338,11 +1335,10 @@ difference between them is mostly just notation; here's a summary of where
they differ:

Capability in Vimspeak in Perlspeak ~
----------------------------------------------------------------
force case insensitivity \c (?i)
force case sensitivity \C (?-i)
backref-less grouping \%(atom\) (?:atom)
conservative quantifiers \{-n,m} *?, +?, ??, {}?
conservative quantifiers \{-n,m} `*?,` +?, ??, {}?
0-width match atom\@= (?=atom)
0-width non-match atom\@! (?!atom)
0-width preceding match atom\@<= (?<=atom)
Expand Down
Loading

0 comments on commit c0dd7ed

Please sign in to comment.