summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-02-27 15:49:53 +0000
committerBram Moolenaar <Bram@vim.org>2023-02-27 15:49:53 +0000
commitdd60c365cd2630794be84d63c4fe287124a30b97 (patch)
tree560fe950798f2987865d532ebe0e06e60b78f3cc /runtime
parent341f3876b34f47fdb1c82b0ad9bae448be73a220 (diff)
Update runtime files
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/dist/vimindent.vim9
-rw-r--r--runtime/autoload/python.vim9
-rw-r--r--runtime/doc/builtin.txt7
-rw-r--r--runtime/doc/change.txt12
-rw-r--r--runtime/doc/eval.txt10
-rw-r--r--runtime/doc/gui.txt4
-rw-r--r--runtime/doc/map.txt9
-rw-r--r--runtime/doc/repeat.txt3
-rw-r--r--runtime/doc/sign.txt16
-rw-r--r--runtime/doc/syntax.txt22
-rw-r--r--runtime/doc/tags5
-rw-r--r--runtime/doc/todo.txt14
-rw-r--r--runtime/doc/version7.txt6
-rw-r--r--runtime/doc/vim9.txt7
-rw-r--r--runtime/doc/vim9class.txt8
-rw-r--r--runtime/filetype.vim2
-rw-r--r--runtime/ftplugin/quarto.vim1
-rw-r--r--runtime/ftplugin/r.vim4
-rw-r--r--runtime/ftplugin/rhelp.vim4
-rw-r--r--runtime/ftplugin/rmd.vim21
-rw-r--r--runtime/ftplugin/rnoweb.vim21
-rw-r--r--runtime/ftplugin/rrst.vim4
-rw-r--r--runtime/indent/quarto.vim1
-rw-r--r--runtime/indent/r.vim14
-rw-r--r--runtime/indent/rhelp.vim4
-rw-r--r--runtime/indent/rmd.vim6
-rw-r--r--runtime/indent/rnoweb.vim4
-rw-r--r--runtime/indent/rrst.vim4
-rw-r--r--runtime/plugin/matchparen.vim5
-rw-r--r--runtime/syntax/python.vim20
-rw-r--r--runtime/syntax/python2.vim345
-rw-r--r--runtime/syntax/quarto.vim17
-rw-r--r--runtime/syntax/r.vim48
-rw-r--r--runtime/syntax/rmd.vim209
-rw-r--r--runtime/syntax/sh.vim11
35 files changed, 683 insertions, 203 deletions
diff --git a/runtime/autoload/dist/vimindent.vim b/runtime/autoload/dist/vimindent.vim
index 8d86543cb4..1306d1e361 100644
--- a/runtime/autoload/dist/vimindent.vim
+++ b/runtime/autoload/dist/vimindent.vim
@@ -1121,13 +1121,8 @@ def Is_IN_KeywordForLoop(line_1: string, line_2: string): bool # {{{3
enddef
def InCommentOrString(): bool # {{{3
- for synID: number in synstack('.', col('.'))
- if synIDattr(synID, 'name') =~ '\ccomment\|string\|heredoc'
- return true
- endif
- endfor
-
- return false
+ return synstack('.', col('.'))
+ ->indexof((_, id: number): bool => synIDattr(id, 'name') =~ '\ccomment\|string\|heredoc') >= 0
enddef
def AlsoClosesBlock(line_B: dict<any>): bool # {{{3
diff --git a/runtime/autoload/python.vim b/runtime/autoload/python.vim
index 1eaad09ef5..d5f4862363 100644
--- a/runtime/autoload/python.vim
+++ b/runtime/autoload/python.vim
@@ -22,8 +22,7 @@ let s:maxoff = 50 " maximum number of lines to look backwards for ()
function s:SearchBracket(fromlnum, flags)
return searchpairpos('[[({]', '', '[])}]', a:flags,
\ {-> synstack('.', col('.'))
- \ ->map({_, id -> id->synIDattr('name')})
- \ ->match('\%(Comment\|Todo\|String\)$') >= 0},
+ \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\|String\)$'}) >= 0},
\ [0, a:fromlnum - s:maxoff]->max(), g:python_indent.searchpair_timeout)
endfunction
@@ -157,15 +156,13 @@ function python#GetIndent(lnum, ...)
" the start of the comment. synID() is slow, a linear search would take
" too long on a long line.
if synstack(plnum, pline_len)
- \ ->map({_, id -> id->synIDattr('name')})
- \ ->match('\%(Comment\|Todo\)$') >= 0
+ \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\)$'}) >= 0
let min = 1
let max = pline_len
while min < max
let col = (min + max) / 2
if synstack(plnum, col)
- \ ->map({_, id -> id->synIDattr('name')})
- \ ->match('\%(Comment\|Todo\)$') >= 0
+ \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\)$'}) >= 0
let max = col
else
let min = col + 1
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index a065fcea2d..a695547eeb 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,4 +1,4 @@
-*builtin.txt* For Vim version 9.0. Last change: 2023 Feb 14
+*builtin.txt* For Vim version 9.0. Last change: 2023 Feb 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2569,8 +2569,7 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
extendnew({expr1}, {expr2} [, {expr3}]) *extendnew()*
Like |extend()| but instead of adding items to {expr1} a new
List or Dictionary is created and returned. {expr1} remains
- unchanged. Items can still be changed by {expr2}, if you
- don't want that use |deepcopy()| first.
+ unchanged.
feedkeys({string} [, {mode}]) *feedkeys()*
@@ -9811,6 +9810,8 @@ timer_start({time}, {callback} [, {options}])
{time} is the waiting time in milliseconds. This is the
minimum time before invoking the callback. When the system is
busy or Vim is not waiting for input the time will be longer.
+ Zero can be used to execute the callback when Vim is back in
+ the main loop.
{callback} is the function to call. It can be the name of a
function or a |Funcref|. It is called with one argument, which
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 85bacbb038..4fc20cae4f 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt* For Vim version 9.0. Last change: 2022 Nov 20
+*change.txt* For Vim version 9.0. Last change: 2023 Feb 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -296,7 +296,9 @@ gr{char} Replace the virtual characters under the cursor with
{char}. This replaces in screen space, not file
space. See |gR| and |Virtual-Replace-mode| for more
details. As with |r| a count may be given.
- {char} can be entered like with |r|.
+ {char} can be entered like with |r|, but characters
+ that have a special meaning in Insert mode, such as
+ most CTRL-keys, cannot be used.
*digraph-arg*
The argument for Normal mode commands like |r| and |t| is a single character.
@@ -1033,7 +1035,7 @@ inside of strings can change! Also see 'softtabstop' option. >
< to display registers '1' and 'a'. Spaces are allowed
in {arg}.
- *:di* *:display*
+ *:di* *:dis* *:display*
:di[splay] [arg] Same as :registers.
*y* *yank*
@@ -1842,9 +1844,9 @@ editing text paragraphs. A few hints on how to use this:
- Set 'formatoptions' to "aw2tq" to make text with indents like this:
- bla bla foobar bla
+ bla bla foobar bla
bla foobar bla foobar bla
- bla bla foobar bla
+ bla bla foobar bla
bla foobar bla bla foobar
- Add the 'c' flag to only auto-format comments. Useful in source code.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index bee0ad6cb7..84f5f5fccb 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 9.0. Last change: 2023 Jan 12
+*eval.txt* For Vim version 9.0. Last change: 2023 Feb 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4581,10 +4581,10 @@ The input is in the variable "line", the results in the variables "file",
getting the scriptnames in a Dictionary ~
*scriptnames-dictionary*
-The |:scriptnames| command can be used to get a list of all script files that
-have been sourced. There is no equivalent function or variable for this
-(because it's rarely needed). In case you need to manipulate the list this
-code can be used: >
+The `:scriptnames` command can be used to get a list of all script files that
+have been sourced. There is also the `getscriptinfo()` function, but the
+information returned is not exactly the same. In case you need to manipulate
+the output of `scriptnames` this code can be used: >
" Get the output of ":scriptnames" in the scriptnames_output variable.
let scriptnames_output = ''
redir => scriptnames_output
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index 17fa848c83..724318dfdc 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -1,4 +1,4 @@
-*gui.txt* For Vim version 9.0. Last change: 2022 Nov 17
+*gui.txt* For Vim version 9.0. Last change: 2023 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -856,7 +856,7 @@ Example for debugger tools: >
nnoremenu 1.20 WinBar.Next :Next<CR>
nnoremenu 1.30 WinBar.Finish :Finish<CR>
nnoremenu 1.40 WinBar.Cont :Continue<CR>
-<
+< *hl-ToolbarLine* *hl-ToolbarButton*
The window toolbar uses the ToolbarLine and ToolbarButton highlight groups.
When splitting the window the window toolbar is not copied to the new window.
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index ef3126193c..905f9adbef 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,4 +1,4 @@
-*map.txt* For Vim version 9.0. Last change: 2023 Feb 18
+*map.txt* For Vim version 9.0. Last change: 2023 Feb 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1073,7 +1073,7 @@ translated). The meaning of {value}:
On protocol is used
Disabled protocol was used but expected to have been disabled
by 't_TE'
- Cleared protocol expected to have beeen disabled by 't_TE',
+ Cleared protocol expected to have been disabled by 't_TE',
previous state is unknown
@@ -1421,12 +1421,13 @@ this, they can be made local to the script.
*<SID>* *<SNR>* *E81*
The string "<SID>" can be used in a mapping or menu. This requires that the
-'<' flag is not present in 'cpoptions'.
+'<' flag is not present in 'cpoptions'. This is useful if you have a
+script-local function that you want to call from a mapping in the same script.
When executing the map command, Vim will replace "<SID>" with the special
key code <SNR>, followed by a number that's unique for the script, and an
underscore. Example: >
:map <SID>Add
-could define a mapping "<SNR>23_Add".
+would define a mapping "<SNR>23_Add".
When defining a function in a script, "s:" can be prepended to the name to
make it local to the script (in |Vim9| script functions without a prefix are
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 56e9ad82ff..c8a0f5d3d1 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1,4 +1,4 @@
-*repeat.txt* For Vim version 9.0. Last change: 2022 Sep 22
+*repeat.txt* For Vim version 9.0. Last change: 2023 Feb 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -423,6 +423,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
after resolving symbolic links got sourced with
another name the other script is after "->". E.g.
"20->22" means script 20 was sourced as script 22.
+ Also see `getscriptinfo()`.
{not available when compiled without the |+eval|
feature}
diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt
index 1a500a4a53..d9bfed697c 100644
--- a/runtime/doc/sign.txt
+++ b/runtime/doc/sign.txt
@@ -1,4 +1,4 @@
-*sign.txt* For Vim version 9.0. Last change: 2022 Dec 20
+*sign.txt* For Vim version 9.0. Last change: 2023 Feb 21
VIM REFERENCE MANUAL by Gordon Prieur
@@ -614,23 +614,23 @@ sign_placelist({list})
|sign_place()| function. The {list} argument specifies the
List of signs to place. Each list item is a dict with the
following sign attributes:
- buffer buffer name or number. For the accepted
+ buffer Buffer name or number. For the accepted
values, see |bufname()|.
- group sign group. {group} functions as a namespace
+ group Sign group. {group} functions as a namespace
for {id}, thus two groups can use the same
IDs. If not specified or set to an empty
string, then the global group is used. See
|sign-group| for more information.
- id sign identifier. If not specified or zero,
+ id Sign identifier. If not specified or zero,
then a new unique identifier is allocated.
Otherwise the specified number is used. See
|sign-identifier| for more information.
- lnum line number in the buffer where the sign is to
+ lnum Line number in the buffer where the sign is to
be placed. For the accepted values, see
|line()|.
- name name of the sign to place. See |sign_define()|
- for more information.
- priority priority of the sign. When multiple signs are
+ name Name of the sign to place. See |sign_define()|
+ for more information.
+ priority Priority of the sign. When multiple signs are
placed on a line, the sign with the highest
priority is used. If not specified, the
default value of 10 is used. See
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index eed82f1e84..d624e4d468 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt* For Vim version 9.0. Last change: 2023 Feb 20
+*syntax.txt* For Vim version 9.0. Last change: 2023 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2791,17 +2791,25 @@ For highlighted doctests and code inside: >
:let python_no_doctest_highlight = 1
or >
:let python_no_doctest_code_highlight = 1
-(first option implies second one).
+The first option implies the second one.
For highlighted trailing whitespace and mix of spaces and tabs: >
:let python_space_error_highlight = 1
-If you want all possible Python highlighting (the same as setting the
-preceding last option and unsetting all other ones): >
+If you want all possible Python highlighting:
:let python_highlight_all = 1
+This has the same effect as setting python_space_error_highlight and
+unsetting all the other ones.
+
+If you use Python 2 or straddling code (Python 2 and 3 compatible),
+you can enforce the use of an older syntax file with support for
+Python 2 and up to Python 3.5.
+ : let python_use_python2_syntax = 1
+This option will exclude all modern Python 3.6 or higher features.
+
+Note: Only existence of these options matters, not their value.
+ You can replace 1 above with anything.
-Note: Only existence of these options matter, not their value. You can replace
- 1 above with anything.
QUAKE *quake.vim* *ft-quake-syntax*
@@ -5370,7 +5378,7 @@ ColorColumn Used for the columns set with 'colorcolumn'.
*hl-Conceal*
Conceal Placeholder characters substituted for concealed
text (see 'conceallevel').
- *hl-Cursor*
+ *hl-Cursor* *hl-lCursor*
Cursor Character under the cursor.
lCursor Character under the cursor when |language-mapping|
is used (see 'guicursor').
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 3a831010d4..61e7c692fa 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -2459,6 +2459,7 @@ $quote eval.txt /*$quote*
:diffupdate diff.txt /*:diffupdate*
:dig digraph.txt /*:dig*
:digraphs digraph.txt /*:digraphs*
+:dis change.txt /*:dis*
:disa vim9.txt /*:disa*
:disassemble vim9.txt /*:disassemble*
:display change.txt /*:display*
@@ -4433,6 +4434,7 @@ E1359 vim9class.txt /*E1359*
E136 starting.txt /*E136*
E1360 vim9class.txt /*E1360*
E1361 syntax.txt /*E1361*
+E1362 vim9class.txt /*E1362*
E137 starting.txt /*E137*
E138 starting.txt /*E138*
E139 message.txt /*E139*
@@ -7898,6 +7900,8 @@ hl-TabLineFill syntax.txt /*hl-TabLineFill*
hl-TabLineSel syntax.txt /*hl-TabLineSel*
hl-Terminal syntax.txt /*hl-Terminal*
hl-Title syntax.txt /*hl-Title*
+hl-ToolbarButton gui.txt /*hl-ToolbarButton*
+hl-ToolbarLine gui.txt /*hl-ToolbarLine*
hl-Tooltip syntax.txt /*hl-Tooltip*
hl-User1 syntax.txt /*hl-User1*
hl-User1..9 syntax.txt /*hl-User1..9*
@@ -7909,6 +7913,7 @@ hl-WarningMsg syntax.txt /*hl-WarningMsg*
hl-WildMenu syntax.txt /*hl-WildMenu*
hl-debugBreakpoint terminal.txt /*hl-debugBreakpoint*
hl-debugPC terminal.txt /*hl-debugPC*
+hl-lCursor syntax.txt /*hl-lCursor*
hlID() builtin.txt /*hlID()*
hlexists() builtin.txt /*hlexists()*
hlget() builtin.txt /*hlget()*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 87aa88e934..6792ac5832 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 9.0. Last change: 2023 Feb 20
+*todo.txt* For Vim version 9.0. Last change: 2023 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -41,12 +41,13 @@ browser use: https://github.com/vim/vim/issues/1234
Crash when splitting window: #11961. Set RedrawingDisabled in
win_split_ins().
-Do not use tt_member for class_T, add tt_class.
-
CI: include #12008 end of February.
In runtime/autoload/dist/script.vim change "set ft=" to "setlocal ft=" ?
+CTRL-J mapping is not used if halfway another mapping. #12002
+Is simplified mapping not used but escape code has been simplified?
+
Include #11952 after a runtime files update.
Errors when running tests with valgrind:
@@ -74,6 +75,8 @@ Further Vim9 improvements, possibly after launch:
- implement :class and :interface: See |vim9-classes
- Change access: public by default, private by prefixing "_".
Check for error: can't have same name twice (ignoring "_" prefix).
+ - Make ":defcompile ClassName" compile all functions and methods in the
+ class.
- Private methods?
either: private def Func()
or: def _Func()
@@ -97,6 +100,7 @@ Further Vim9 improvements, possibly after launch:
this at runtime.
- implement :type
- implement :enum
+- Promise class, could be used to wait on a popup close callback?
- class local to a function
- Use Vim9 for more runtime files.
- Inline call to map() and filter(), better type checking.
@@ -320,9 +324,10 @@ to have text in the center.
Add some kind of ":whathappend" command and functions to make visible what the
last few typed keys and executed commands are. To be used when the user
-wonders what went wrong.
+wonders what went wrong. Could also be used for statistics #12046.
- typed keys - Normal mode command - like what is recorded in a register and
displayed by 'showcmd'.
+- register used - #12063
- executed command lines
- with more verbosity: what scripts/functions/autocommands were executed
@@ -701,6 +706,7 @@ Added tests (James McCoy, 2016 Aug 3, #958). Still needs more work.
Would be nice to set tab-local values for 'diffexpr' and 'diffopt'. Use
t:diffexpr_option t:diffopt_option? (#4782)
+Also make 'scrollopt' tab-local, remove "hor" only for the current tab page.
Internal diff doesn't handle binary file like external diff does. (Mike
Williams, 2018 Oct 30)
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 857a1f4147..c7248c2d27 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -8123,7 +8123,7 @@ Files: src/message.c
Patch 7.2.119
Problem: Status line is redrawn too often.
-Solution: Check ScreeenLinesUC[] properly. (Yukihiro Nakadaira)
+Solution: Check ScreenLinesUC[] properly. (Yukihiro Nakadaira)
Files: src/screen.c
Patch 7.2.120
@@ -9782,8 +9782,8 @@ Files: src/syntax.c
Patch 7.2.406
Problem: Patch 7.2.119 introduces uninit mem read. (Dominique Pelle)
-Solution: Only used ScreeenLinesC when ScreeenLinesUC is not zero. (Yukihiro
- Nakadaira) Also clear ScreeenLinesC when allocating.
+Solution: Only used ScreenLinesC when ScreenLinesUC is not zero. (Yukihiro
+ Nakadaira) Also clear ScreenLinesC when allocating.
Files: src/screen.c
Patch 7.2.407
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index c6c04a9856..bb4a096072 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1,4 +1,4 @@
-*vim9.txt* For Vim version 9.0. Last change: 2022 Dec 08
+*vim9.txt* For Vim version 9.0. Last change: 2023 Feb 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1254,6 +1254,7 @@ level. They cannot be created in a function, also not in a legacy function.
:defc[ompile] Compile functions defined in the current script that
were not compiled yet.
This will report any errors found during compilation.
+ This excludes functions defined inside a class.
:defc[ompile] {func}
:defc[ompile] debug {func}
@@ -1261,6 +1262,10 @@ level. They cannot be created in a function, also not in a legacy function.
Compile function {func}, if needed. Use "debug" and
"profile" to specify the compilation mode.
This will report any errors found during compilation.
+ {func} call also be "ClassName.functionName" to
+ compile a function or method in a class.
+ {func} call also be "ClassName" to compile all
+ functions and methods in a class.
*:disa* *:disassemble*
:disa[ssemble] {func} Show the instructions generated for {func}.
diff --git a/runtime/doc/vim9class.txt b/runtime/doc/vim9class.txt
index 1f6c57f393..3c7722c88f 100644
--- a/runtime/doc/vim9class.txt
+++ b/runtime/doc/vim9class.txt
@@ -1,4 +1,4 @@
-*vim9class.txt* For Vim version 9.0. Last change: 2023 Feb 19
+*vim9class.txt* For Vim version 9.0. Last change: 2023 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -469,7 +469,7 @@ interface, which is often done in many languages, especially Java.
Items in a class ~
*E1318* *E1325* *E1326*
-Inside a class, in betweeen `:class` and `:endclass`, these items can appear:
+Inside a class, in between `:class` and `:endclass`, these items can appear:
- An object member declaration: >
this._memberName: memberType
this.memberName: memberType
@@ -522,11 +522,11 @@ An interface can only be defined in a |Vim9| script file. *E1342*
null object ~
-When a variable is decleared to have the type of an object, but it is not
+When a variable is declared to have the type of an object, but it is not
initialized, the value is null. When trying to use this null object Vim often
does not know what class was supposed to be used. Vim then cannot check if
a member name is correct and you will get an "Using a null object" error,
-even when the member name is invalid. *E1360*
+even when the member name is invalid. *E1360* *E1362*
Default constructor ~
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 1e80997017..247f9acf3b 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2023 Feb 07
+" Last Change: 2023 Feb 25
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
diff --git a/runtime/ftplugin/quarto.vim b/runtime/ftplugin/quarto.vim
new file mode 100644
index 0000000000..a76bcc2c7e
--- /dev/null
+++ b/runtime/ftplugin/quarto.vim
@@ -0,0 +1 @@
+runtime ftplugin/rmd.vim
diff --git a/runtime/ftplugin/r.vim b/runtime/ftplugin/r.vim
index a78afa2e7e..28966368cb 100644
--- a/runtime/ftplugin/r.vim
+++ b/runtime/ftplugin/r.vim
@@ -2,7 +2,7 @@
" Language: R
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Sat Aug 15, 2020 11:37AM
+" Last Change: Sun Apr 24, 2022 09:14AM
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
@@ -22,7 +22,7 @@ setlocal comments=:#',:###,:##,:#
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R)\t*.R\n" .
- \ "Files that include R (*.Rnw *.Rd *.Rmd *.Rrst)\t*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
+ \ "Files that include R (*.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" .
\ "All Files (*.*)\t*.*\n"
endif
diff --git a/runtime/ftplugin/rhelp.vim b/runtime/ftplugin/rhelp.vim
index d0b546d62d..2fde4875c6 100644
--- a/runtime/ftplugin/rhelp.vim
+++ b/runtime/ftplugin/rhelp.vim
@@ -2,7 +2,7 @@
" Language: R help file
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Sat Aug 15, 2020 12:01PM
+" Last Change: Sun Apr 24, 2022 09:12AM
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
@@ -18,7 +18,7 @@ set cpo&vim
setlocal iskeyword=@,48-57,_,.
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
- let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
+ let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" .
\ "All Files (*.*)\t*.*\n"
endif
diff --git a/runtime/ftplugin/rmd.vim b/runtime/ftplugin/rmd.vim
index 2ee72ffc6c..355b88f04a 100644
--- a/runtime/ftplugin/rmd.vim
+++ b/runtime/ftplugin/rmd.vim
@@ -2,7 +2,7 @@
" Language: R Markdown file
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Sat Aug 15, 2020 12:03PM
+" Last Change: Sun Apr 24, 2022 09:12AM
" Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann)
" Only do this when not yet done for this buffer
@@ -32,13 +32,24 @@ function! FormatRmd()
return 1
endfunction
-" If you do not want 'comments' dynamically defined, put in your vimrc:
-" let g:rmd_dynamic_comments = 0
+function! SetRmdCommentStr()
+ if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW'))
+ set commentstring=#\ %s
+ else
+ set commentstring=<!--\ %s\ -->
+ endif
+endfunction
+
+" If you do not want both 'comments' and 'commentstring' dynamically defined,
+" put in your vimrc: let g:rmd_dynamic_comments = 0
if !exists("g:rmd_dynamic_comments") || (exists("g:rmd_dynamic_comments") && g:rmd_dynamic_comments == 1)
setlocal formatexpr=FormatRmd()
+ augroup RmdCStr
+ autocmd!
+ autocmd CursorMoved <buffer> call SetRmdCommentStr()
+ augroup END
endif
-
" Enables pandoc if it is installed
unlet! b:did_ftplugin
runtime ftplugin/pandoc.vim
@@ -47,7 +58,7 @@ runtime ftplugin/pandoc.vim
let b:did_ftplugin = 1
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
- let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
+ let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" .
\ "All Files (*.*)\t*.*\n"
endif
diff --git a/runtime/ftplugin/rnoweb.vim b/runtime/ftplugin/rnoweb.vim
index dc5f1b5e06..cf1c0922c0 100644
--- a/runtime/ftplugin/rnoweb.vim
+++ b/runtime/ftplugin/rnoweb.vim
@@ -2,7 +2,7 @@
" Language: Rnoweb
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Sat Aug 15, 2020 12:02PM
+" Last Change: Sun Apr 24, 2022 09:13AM
" Only do this when not yet done for this buffer
if exists("b:did_ftplugin")
@@ -25,10 +25,27 @@ setlocal suffixesadd=.bib,.tex
setlocal comments=b:%,b:#,b:##,b:###,b:#'
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
- let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
+ let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" .
\ "All Files (*.*)\t*.*\n"
endif
+function! SetRnwCommentStr()
+ if (search("^\s*<<.*>>=", "bncW") > search("^@", "bncW"))
+ set commentstring=#\ %s
+ else
+ set commentstring=%\ %s
+ endif
+endfunction
+
+" If you do not want both 'comments' and 'commentstring' dynamically defined,
+" put in your vimrc: let g:rnw_dynamic_comments = 0
+if !exists("g:rnw_dynamic_comments") || (exists("g:rnw_dynamic_comments") && g:rnw_dynamic_comments == 1)
+ augroup RnwCStr
+ autocmd!
+ autocmd CursorMoved <buffer> call SetRnwCommentStr()
+ augroup END
+endif
+
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= " | setl isk< sua< com< | unlet! b:browsefilter"
else
diff --git a/runtime/ftplugin/rrst.vim b/runtime/ftplugin/rrst.vim
index a56fd6478e..19c67c4cc2 100644
--- a/runtime/ftplugin/rrst.vim
+++ b/runtime/ftplugin/rrst.vim
@@ -2,7 +2,7 @@
" Language: reStructuredText documentation format with R code
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change: Sat Aug 15, 2020 12:02PM
+" Last Change: Sun Apr 24, 2022 09:1