summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-10 13:13:14 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-10 13:13:14 +0100
commit71b6d3397649fed68ef587aa863fcbdf5fdb057a (patch)
treefe1de667a3a2f1a69ad6533ab87be8e8c5c33273
parent2da11a4124989e3be917fa8024025d2e1452b363 (diff)
Update runtime files
-rw-r--r--.github/CODEOWNERS19
-rw-r--r--runtime/doc/builtin.txt2
-rw-r--r--runtime/doc/eval.txt8
-rw-r--r--runtime/doc/options.txt2
-rw-r--r--runtime/doc/tags3
-rw-r--r--runtime/doc/tagsrch.txt11
-rw-r--r--runtime/doc/todo.txt23
-rw-r--r--runtime/doc/userfunc.txt7
-rw-r--r--runtime/doc/version9.txt6
-rw-r--r--runtime/doc/vim9.txt30
-rw-r--r--runtime/filetype.vim2
-rw-r--r--runtime/ftplugin/gitattributes.vim13
-rw-r--r--runtime/ftplugin/gitignore.vim13
-rw-r--r--runtime/ftplugin/jsonnet.vim17
-rw-r--r--runtime/ftplugin/lua.vim38
-rw-r--r--runtime/ftplugin/lynx.vim29
-rw-r--r--runtime/ftplugin/sh.vim53
-rw-r--r--runtime/ftplugin/vim.vim12
-rw-r--r--runtime/ftplugin/zimbu.vim4
-rw-r--r--runtime/ftplugin/zsh.vim2
-rw-r--r--runtime/indent/json.vim3
-rw-r--r--runtime/syntax/gitattributes.vim63
-rw-r--r--runtime/syntax/gitignore.vim29
-rw-r--r--runtime/syntax/lua.vim70
-rw-r--r--runtime/syntax/vim.vim18
-rw-r--r--runtime/syntax/zsh.vim163
26 files changed, 499 insertions, 141 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 1cd351fe78..2375b35adc 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -69,6 +69,10 @@ runtime/compiler/perlcritic.vim @petdance @dkearns
runtime/compiler/php.vim @dkearns
runtime/compiler/podchecker.vim @petdance @dkearns
runtime/compiler/powershell.vim @heaths
+runtime/compiler/raco.vim @benknoble
+runtime/compiler/racomake.vim @benknoble
+runtime/compiler/racosetup.vim @benknoble
+runtime/compiler/racotest.vim @benknoble
runtime/compiler/rake.vim @tpope @dkearns
runtime/compiler/rhino.vim @dkearns
runtime/compiler/rspec.vim @tpope @dkearns
@@ -111,6 +115,7 @@ runtime/ftplugin/cucumber.vim @tpope
runtime/ftplugin/desktop.vim @e-kwsm
runtime/ftplugin/dosbatch.vim @mrdubya
runtime/ftplugin/eiffel.vim @dkearns
+runtime/ftplugin/elixir.vim @mhanberg
runtime/ftplugin/expect.vim @dkearns
runtime/ftplugin/erlang.vim @hcs42
runtime/ftplugin/eruby.vim @tpope @dkearns
@@ -123,8 +128,10 @@ runtime/ftplugin/gdb.vim @xeyownt
runtime/ftplugin/gdscript.vim @habamax
runtime/ftplugin/gdshader.vim @habamax
runtime/ftplugin/git.vim @tpope
+runtime/ftplugin/gitattributes.vim @ObserverOfTime
runtime/ftplugin/gitcommit.vim @tpope
runtime/ftplugin/gitconfig.vim @tpope
+runtime/ftplugin/gitignore.vim @ObserverOfTime
runtime/ftplugin/gitrebase.vim @tpope
runtime/ftplugin/gitsendemail.vim @tpope
runtime/ftplugin/go.vim @dbarnett
@@ -135,6 +142,7 @@ runtime/ftplugin/html.vim @dkearns
runtime/ftplugin/i3config.vim @hiqua
runtime/ftplugin/icon.vim @dkearns
runtime/ftplugin/indent.vim @dkearns
+runtime/ftplugin/j.vim @glts
runtime/ftplugin/javascript.vim @dkearns
runtime/ftplugin/javascriptreact.vim @dkearns
runtime/ftplugin/jsonc.vim @izhakjakov
@@ -143,6 +151,7 @@ runtime/ftplugin/kconfig.vim @chrisbra
runtime/ftplugin/less.vim @genoma
runtime/ftplugin/liquid.vim @tpope
runtime/ftplugin/lua.vim @dkearns
+runtime/ftplugin/lynx.vim @dkearns
runtime/ftplugin/m3build.vim @dkearns
runtime/ftplugin/m3quake.vim @dkearns
runtime/ftplugin/markdown.vim @tpope
@@ -164,6 +173,7 @@ runtime/ftplugin/ps1xml.vim @heaths
runtime/ftplugin/python.vim @tpict
runtime/ftplugin/qb64.vim @dkearns
runtime/ftplugin/r.vim @jalvesaq
+runtime/ftplugin/racket.vim @benknoble
runtime/ftplugin/rhelp.vim @jalvesaq
runtime/ftplugin/rmd.vim @jalvesaq
runtime/ftplugin/rnoweb.vim @jalvesaq
@@ -175,6 +185,7 @@ runtime/ftplugin/sass.vim @tpope
runtime/ftplugin/scala.vim @derekwyatt
runtime/ftplugin/scss.vim @tpope
runtime/ftplugin/sdoc.vim @gpanders
+runtime/ftplugin/sh.vim @dkearns
runtime/ftplugin/solution.vim @dkearns
runtime/ftplugin/spec.vim @ignatenkobrain
runtime/ftplugin/swayconfig.vim @jamespeapen
@@ -219,6 +230,7 @@ runtime/indent/gitolite.vim @sitaramc
runtime/indent/go.vim @dbarnett
runtime/indent/haml.vim @tpope
runtime/indent/idlang.vim @dkearns
+runtime/indent/j.vim @glts
runtime/indent/java.vim @xuhdev
runtime/indent/javascript.vim @bounceme
runtime/indent/json.vim @elzr
@@ -240,6 +252,7 @@ runtime/indent/prolog.vim @dkearns
runtime/indent/ps1.vim @heaths
runtime/indent/qb64.vim @dkearns
runtime/indent/r.vim @jalvesaq
+runtime/indent/racket.vim @benknoble
runtime/indent/readline.vim @dkearns
runtime/indent/rhelp.vim @jalvesaq
runtime/indent/rmd.vim @jalvesaq
@@ -321,8 +334,10 @@ runtime/syntax/gdresource.vim @habamax
runtime/syntax/gdscript.vim @habamax
runtime/syntax/gdshader.vim @habamax
runtime/syntax/git.vim @tpope
+runtime/syntax/gitattributes.vim @ObserverOfTime
runtime/syntax/gitcommit.vim @tpope
runtime/syntax/gitconfig.vim @tpope
+runtime/syntax/gitignore.vim @ObserverOfTime
runtime/syntax/gitolite.vim @sitaramc
runtime/syntax/gitrebase.vim @tpope
runtime/syntax/go.vim @bhcleek
@@ -336,6 +351,7 @@ runtime/syntax/html.vim @dkearns
runtime/syntax/i3config.vim @hiqua
runtime/syntax/icon.vim @dkearns
runtime/syntax/indent.vim @dkearns
+runtime/syntax/j.vim @glts
runtime/syntax/jargon.vim @h3xx
runtime/syntax/java.vim @fleiner
runtime/syntax/jsonc.vim @izhakjakov
@@ -377,6 +393,7 @@ runtime/syntax/ps1xml.vim @heaths
runtime/syntax/psl.vim @danielkho
runtime/syntax/qb64.vim @dkearns
runtime/syntax/r.vim @jalvesaq
+runtime/syntax/racket.vim @benknoble
runtime/syntax/raml.vim @in3d
runtime/syntax/ratpoison.vim @trapd00r
runtime/syntax/rc.vim @chrisbra
@@ -404,7 +421,7 @@ runtime/syntax/sshconfig.vim @Jakuje
runtime/syntax/sshdconfig.vim @Jakuje
runtime/syntax/sudoers.vim @e-kwsm
runtime/syntax/svn.vim @hdima
-runtime/syntax/swayconfig.vim @jamespeapen
+runtime/syntax/swayconfig.vim @jamespeapen
runtime/syntax/systemverilog.vim @Kocha
runtime/syntax/tags.vim @cecamp
runtime/syntax/tap.vim @petdance
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 01263402fa..3448ed5855 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,4 +1,4 @@
-*builtin.txt* For Vim version 9.0. Last change: 2022 Jun 27
+*builtin.txt* For Vim version 9.0. Last change: 2022 Sep 10
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 741f70ad64..e99e9baa0a 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 9.0. Last change: 2022 Jun 17
+*eval.txt* For Vim version 9.0. Last change: 2022 Sep 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1718,6 +1718,9 @@ Recommendation: don't do this.
Notice how execute() is used to execute an Ex command. That's ugly though.
In Vim9 script you can use a command block, see |inline-function|.
+Although you can use the loop variable of a `for` command, it must still exist
+when the closure is called, otherwise you get an error. *E1302*
+
Lambda expressions have internal names like '<lambda>42'. If you get an error
for a lambda expression, you can find what it is with the following command: >
:function <lambda>42
@@ -3397,7 +3400,8 @@ text...
it will show for three seconds and avoid a
|hit-enter| prompt. If you want to hide it before
that, press Esc in Normal mode (when it would
- otherwise beep).
+ otherwise beep). If it disappears too soon you can
+ use `:messages` to see the text.
The message window is available when Vim was compiled
with the +timer and the +popupwin features.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 1b9ae38db6..b60abc271d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 9.0. Last change: 2022 Jun 27
+*options.txt* For Vim version 9.0. Last change: 2022 Sep 09
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 9ff4218366..b38f1cc516 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -4332,7 +4332,10 @@ E1295 textprop.txt /*E1295*
E1296 textprop.txt /*E1296*
E1297 vim9.txt /*E1297*
E1298 vim9.txt /*E1298*
+E1299 tagsrch.txt /*E1299*
E13 message.txt /*E13*
+E1300 userfunc.txt /*E1300*
+E1302 eval.txt /*E1302*
E131 userfunc.txt /*E131*
E132 userfunc.txt /*E132*
E133 userfunc.txt /*E133*
diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
index 4c49e44d02..e7a522feba 100644
--- a/runtime/doc/tagsrch.txt
+++ b/runtime/doc/tagsrch.txt
@@ -889,13 +889,16 @@ like |CTRL-]|.
The function used for generating the taglist is specified by setting the
'tagfunc' option. The function will be called with three arguments:
- a:pattern The tag identifier or pattern used during the tag search.
- a:flags String containing flags to control the function behavior.
- a:info Dict containing the following entries:
+ pattern The tag identifier or pattern used during the tag search.
+ flags String containing flags to control the function behavior.
+ info Dict containing the following entries:
buf_ffname Full filename which can be used for priority.
user_data Custom data String, if stored in the tag
stack previously by tagfunc.
+Note that in a legacy function "a:" needs to be prepended to the argument name
+when using it.
+
Currently up to three flags may be passed to the tag function:
'c' The function was invoked by a normal command being processed
(mnemonic: the tag function may use the context around the
@@ -931,6 +934,8 @@ If the function returns |v:null| instead of a List, a standard tag lookup will
be performed instead.
It is not allowed to change the tagstack from inside 'tagfunc'. *E986*
+It is not allowed to close a window or change window from inside 'tagfunc'.
+*E1299*
The following is a hypothetical example of a function used for 'tagfunc'. It
uses the output of |taglist()| to generate the result: a list of tags in the
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 71b8b0f07c..b22c2564f2 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 9.0. Last change: 2022 Jun 27
+*todo.txt* For Vim version 9.0. Last change: 2022 Sep 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,17 +38,14 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
-When using :echomessage do use msg_row and msg_col, but save and restore.
-How to test any failure?
+Use :defer command:
+ - Use "D" flag of writefile() and mkdir() in tests.
+ (testdir/test_c*.vim done)
-Improve :defer command:
- - Use "D" flag of writefile() in tests.
- - test "defer func()->funcouter()" fails (or use "funcouter")
- - test "defer func().arg" fails
- - test partial fails
- - check arguments at :defer command
- - Also when function does "qa!" or "cq"?
+When using :echomessage do use msg_row and msg_col, but save and restore.
+How to test any failure? If nothing fails perhaps it's OK alrady.
+Drop Windows XP? #11089
Further Vim9 improvements, possibly after launch:
- Use Vim9 for more runtime files.
@@ -277,6 +274,7 @@ Adding "10" to 'spellsuggest' causes spell suggestions to become very slow.
Also, z= in German on a long word can take a very long time, but CTRL-C to
interrupt does not work. Where to add ui_breakcheck()?
New English spell files also have very slow suggestions.
+French spell files don't work correctly. #4916
Make "g>" and "g<" in Visual mode move the text right or left.
Also for a block selection. #8558
@@ -2648,6 +2646,11 @@ Better 'rightleft' or BIDI support:
Spell checking:
+- List of common misspellings in English:
+ https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
+ German:
+ https://de.wikipedia.org/wiki/Wikipedia:Liste_von_Tippfehlern/F%C3%BCr_Maschinen
+ There are other languages.
- [s does not find missing capital at start of the line. #10838
Probably because the dot at the end of the previous line isn't seen.
- When 'cursorline' is set and the first word should have SpellCap
diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt
index f6377009b8..24e3fd7daf 100644
--- a/runtime/doc/userfunc.txt
+++ b/runtime/doc/userfunc.txt
@@ -1,4 +1,4 @@
-*userfunc.txt* For Vim version 9.0. Last change: 2022 Jun 17
+*userfunc.txt* For Vim version 9.0. Last change: 2022 Sep 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -23,7 +23,7 @@ commands can be executed with the |:normal| command.
The function name must start with an uppercase letter, to avoid confusion with
builtin functions. To prevent from using the same name in different scripts
-make them script-local. If you do use a global function the avoid obvious,
+make them script-local. If you do use a global function then avoid obvious,
short names. A good habit is to start the function name with the name of the
script, e.g., "HTMLcolor()".
@@ -427,7 +427,8 @@ GetArg()->TheFunc()` does not work, it may work in a later version.
Errors are reported but do not cause aborting execution of deferred functions.
-No range is accepted.
+No range is accepted. The function can be a partial with extra arguments, but
+not with a dictionary. *E1300*
==============================================================================
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index 4e6b1cbf13..9ec13872ab 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -72,7 +72,7 @@ Command line completion in a popup menu ~
Before there was the 'wildmenu' option, which uses the space of one line above
the statusline to show matches. Only a few matches fit there.
-Now a popup menu can be used by setting "wildoptions' to "pum". This allows
+Now a popup menu can be used by setting 'wildoptions' to "pum". This allows
for showing many more matches. This requires redrawing more of the display,
but since computers are fast enough that is not a problem.
@@ -336,7 +336,7 @@ Hide cursor when sleeping using |:sleep!|.
Add "multispace" to 'listchars' to show two or more spaces no matter where
they appear. Add "leadmultispace" to 'listchars' to show two or more leading
spaces. Add "lead" to 'listchars' to set the character used to show leading
-spaces. Support specifying a character using the hexdecimal notation in
+spaces. Support specifying a character using the hexadecimal notation in
'listchars' (\x, \u and \U).
Make 'listchars', 'virtualedit' and 'thesaurusfunc' global-local options.
@@ -28248,7 +28248,7 @@ Files: runtime/doc/repeat.txt, src/scriptfile.c, src/vim9script.c,
src/proto/vim9script.pro, src/testdir/test_source.vim
Patch 8.2.4608
-Problem: getcompletion() does not work properly when 'wildoptions
+Problem: getcompletion() does not work properly when 'wildoptions'
contains "fuzzy".
Solution: Do not use addstar(). (Yegappan Lakshmanan, closes #9992,
closes #9986)
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index aba0f0051e..ce9cbdf3b0 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 Jun 25
+*vim9.txt* For Vim version 9.0. Last change: 2022 Sep 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1311,7 +1311,7 @@ Make sure to define the breakpoint before compiling the outer function.
The "inloop" variable will exist only once, all closures put in the list refer
to the same instance, which in the end will have the value 4. This is
efficient, also when looping many times. If you do want a separate context
-for each closure call a function to define it: >
+for each closure, call a function to define it: >
def GetClosure(i: number): func
var infunc = i
return () => infunc
@@ -1327,6 +1327,30 @@ for each closure call a function to define it: >
In some situations, especially when calling a Vim9 closure from legacy
context, the evaluation will fail. *E1248*
+Note that at the script level the loop variable will be invalid after the
+loop, also when used in a closure that is called later, e.g. with a timer.
+This will generate error |E1302|: >
+ for n in range(4)
+ timer_start(500 * n, (_) => {
+ echowin n
+ })
+ endfor
+
+You need to create a closure to store the current value of "n", so that it is
+evaluated at the time the closure is created: >
+ def GetClosure(nr: number): func
+ return (_) => {
+ echowindow nr
+ }
+ enddef
+
+ for n in range(4)
+ timer_start(500 * n, GetClosure(n))
+ endfor
+
+Using `echowindow` is useful in a timer, the messages go into a popup and will
+not interfere with what the user is doing when it triggers.
+
Converting a function from legacy to Vim9 ~
*convert_legacy_function_to_vim9*
@@ -1618,7 +1642,7 @@ type, it can not be used in Vim9 script.
*E1211* *E1217* *E1218* *E1219* *E1220* *E1221*
*E1222* *E1223* *E1224* *E1225* *E1226* *E1227*
*E1228* *E1238* *E1250* *E1251* *E1252* *E1253*
- *E1256* *E1297* *E1298*
+ *E1256* *E1297* *E1298* *E1301*
Types are checked for most builtin functions to make it easier to spot
mistakes.
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 0223402a4b..d88f0256b1 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: 2022 Jul 5
+" Last Change: 2022 Sep 09
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
diff --git a/runtime/ftplugin/gitattributes.vim b/runtime/ftplugin/gitattributes.vim
new file mode 100644
index 0000000000..2025d009d2
--- /dev/null
+++ b/runtime/ftplugin/gitattributes.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language: git attributes
+" Maintainer: ObserverOfTime <chronobserver@disroot.org>
+" Last Change: 2022 Sep 08
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+setl comments=:# commentstring=#\ %s
+
+let b:undo_ftplugin = 'setl com< cms<'
diff --git a/runtime/ftplugin/gitignore.vim b/runtime/ftplugin/gitignore.vim
new file mode 100644
index 0000000000..3502dd2717
--- /dev/null
+++ b/runtime/ftplugin/gitignore.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language: git ignore
+" Maintainer: ObserverOfTime <chronobserver@disroot.org>
+" Last Change: 2022 Sep 10
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+setl comments=:# commentstring=#\ %s
+
+let b:undo_ftplugin = 'setl com< cms<'
diff --git a/runtime/ftplugin/jsonnet.vim b/runtime/ftplugin/jsonnet.vim
new file mode 100644
index 0000000000..1e621e1867
--- /dev/null
+++ b/runtime/ftplugin/jsonnet.vim
@@ -0,0 +1,17 @@
+" Vim filetype plugin
+" Language: Jsonnet
+" Maintainer: Cezary Drożak <cezary@drozak.net>
+" URL: https://github.com/google/vim-jsonnet
+" Last Change: 2022-09-08
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+setlocal commentstring=//\ %s
+
+let b:undo_ftplugin = "setlocal commentstring<"
diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim
index 2604257594..aaa61f71d9 100644
--- a/runtime/ftplugin/lua.vim
+++ b/runtime/ftplugin/lua.vim
@@ -1,46 +1,46 @@
" Vim filetype plugin file.
-" Language: Lua
+" Language: Lua
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Max Ischenko <mfi@ukr.net>
-" Last Change: 2021 Nov 15
+" Contributor: Dorai Sitaram <ds26@gte.com>
+" Last Change: 2022 Sep 05
-" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
-
-" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
-" Set 'formatoptions' to break comment lines but not other lines, and insert
-" the comment leader when hitting <CR> or using "o".
+setlocal comments=:--
+setlocal commentstring=--\ %s
setlocal formatoptions-=t formatoptions+=croql
-setlocal comments=:--
-setlocal commentstring=--%s
+let &l:define = '\<function\|\<local\%(\s\+function\)\='
+
setlocal suffixesadd=.lua
-let b:undo_ftplugin = "setlocal fo< com< cms< sua<"
+let b:undo_ftplugin = "setlocal cms< com< def< fo< sua<"
if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 0
let b:match_words =
- \ '\<\%(do\|function\|if\)\>:' .
- \ '\<\%(return\|else\|elseif\)\>:' .
- \ '\<end\>,' .
- \ '\<repeat\>:\<until\>,' .
- \ '\%(--\)\=\[\(=*\)\[:]\1]'
- let b:undo_ftplugin .= " | unlet! b:match_words b:match_ignorecase"
+ \ '\<\%(do\|function\|if\)\>:' ..
+ \ '\<\%(return\|else\|elseif\)\>:' ..
+ \ '\<end\>,' ..
+ \ '\<repeat\>:\<until\>,' ..
+ \ '\%(--\)\=\[\(=*\)\[:]\1]'
+ let b:undo_ftplugin ..= " | unlet! b:match_words b:match_ignorecase"
endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
- let b:browsefilter = "Lua Source Files (*.lua)\t*.lua\n" .
- \ "All Files (*.*)\t*.*\n"
- let b:undo_ftplugin .= " | unlet! b:browsefilter"
+ let b:browsefilter = "Lua Source Files (*.lua)\t*.lua\n" ..
+ \ "All Files (*.*)\t*.*\n"
+ let b:undo_ftplugin ..= " | unlet! b:browsefilter"
endif
let &cpo = s:cpo_save
unlet s:cpo_save
+
+" vim: nowrap sw=2 sts=2 ts=8 noet:
diff --git a/runtime/ftplugin/lynx.vim b/runtime/ftplugin/lynx.vim
new file mode 100644
index 0000000000..b76c69f0ae
--- /dev/null
+++ b/runtime/ftplugin/lynx.vim
@@ -0,0 +1,29 @@
+" Vim filetype plugin file
+" Language: Lynx Web Browser Configuration
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2022 Sep 09
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+setlocal comments=:#
+setlocal commentstring=#\ %s
+setlocal formatoptions-=t formatoptions+=croql
+
+let b:undo_ftplugin = "setl cms< com< fo<"
+
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
+ let b:browsefilter = "Lynx Configuration Files (lynx.cfg .lynxrc)\tlynx.cfg;.lynxrc\n" ..
+ \ "All Files (*.*)\t*.*\n"
+ let b:undo_ftplugin ..= " | unlet! b:browsefilter"
+endif
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: nowrap sw=2 sts=2 ts=8 noet:
diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim
index 93a46f63e2..b6fdb8f3e2 100644
--- a/runtime/ftplugin/sh.vim
+++ b/runtime/ftplugin/sh.vim
@@ -1,12 +1,12 @@
" Vim filetype plugin file
-" Language: sh
-"
-" This runtime file is looking for a new maintainer.
-"
-" Former maintainer: Dan Sharp
-" Last Changed: 20 Jan 2009
-
-if exists("b:did_ftplugin") | finish | endif
+" Language: sh
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Previous Maintainer: Dan Sharp
+" Last Change: 2022 Sep 07
+
+if exists("b:did_ftplugin")
+ finish
+endif
let b:did_ftplugin = 1
" Make sure the continuation lines below do not cause problems in
@@ -14,28 +14,35 @@ let b:did_ftplugin = 1
let s:save_cpo = &cpo
set cpo-=C
-setlocal commentstring=#%s
+setlocal comments=:#
+setlocal commentstring=#\ %s
+setlocal formatoptions-=t formatoptions+=croql
+
+let b:undo_ftplugin = "setl com< cms< fo<"
" Shell: thanks to Johannes Zellner
-if exists("loaded_matchit")
- let s:sol = '\%(;\s*\|^\s*\)\@<=' " start of line
- let b:match_words =
- \ s:sol.'if\>:' . s:sol.'elif\>:' . s:sol.'else\>:' . s:sol. 'fi\>,' .
- \ s:sol.'\%(for\|while\)\>:' . s:sol. 'done\>,' .
- \ s:sol.'case\>:' . s:sol. 'esac\>'
+if exists("loaded_matchit") && !exists("b:match_words")
+ let b:match_ignorecase = 0
+ let s:sol = '\%(;\s*\|^\s*\)\@<=' " start of line
+ let b:match_words =
+ \ s:sol .. 'if\>:' .. s:sol.'elif\>:' .. s:sol.'else\>:' .. s:sol .. 'fi\>,' ..
+ \ s:sol .. '\%(for\|while\)\>:' .. s:sol .. 'done\>,' ..
+ \ s:sol .. 'case\>:' .. s:sol .. 'esac\>'
+ unlet s:sol
+ let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"
endif
" Change the :browse e filter to primarily show shell-related files.
-if has("gui_win32")
- let b:browsefilter="Bourne Shell Scripts (*.sh)\t*.sh\n" .
- \ "Korn Shell Scripts (*.ksh)\t*.ksh\n" .
- \ "Bash Shell Scripts (*.bash)\t*.bash\n" .
- \ "All Files (*.*)\t*.*\n"
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
+ let b:browsefilter = "Bourne Shell Scripts (*.sh)\t*.sh\n" ..
+ \ "Korn Shell Scripts (*.ksh)\t*.ksh\n" ..
+ \ "Bash Shell Scripts (*.bash)\t*.bash\n" ..
+ \ "All Files (*.*)\t*.*\n"
+ let b:undo_ftplugin ..= " | unlet! b:browsefilter"
endif
-" Undo the stuff we changed.
-let b:undo_ftplugin = "setlocal cms< | unlet! b:browsefilter b:match_words"
-
" Restore the saved compatibility options.
let &cpo = s:save_cpo
unlet s:save_cpo
+
+" vim: nowrap sw=2 sts=2 ts=8 noet:
diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
index 772bfa0429..60934d731d 100644
--- a/runtime/ftplugin/vim.vim
+++ b/runtime/ftplugin/vim.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Vim
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2022 Aug 4
+" Last Change: 2022 Sep 09
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -48,17 +48,17 @@ setlocal isk+=#
" Use :help to lookup the keyword under the cursor with K.
setlocal keywordprg=:help
+" Comments starts with # in Vim9 script. We have to guess which one to use.
if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>'
- " Set 'comments' to format dashed lists in comments
- setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:#
- " Comments starts with # in Vim9 script
setlocal commentstring=#%s
else
- setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
- " Comments starts with a double quote in legacy script
setlocal commentstring=\"%s
endif
+" Set 'comments' to format dashed lists in comments, both in Vim9 and legacy
+" script.
+setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:#,sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
+
" set 'include' to recognize import commands
setlocal include=\\v^\\s*import\\s*(autoload)?
diff --git a/runtime/ftplugin/zimbu.vim b/runtime/ftplugin/zimbu.vim
index c966498c90..9d9fa6f406 100644
--- a/runtime/ftplugin/zimbu.vim
+++ b/runtime/ftplugin/zimbu.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Zimbu
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2021 Nov 12
+" Last Change: 2022 Sep 07
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -28,7 +28,7 @@ endif
" Set 'comments' to format dashed lists in comments.
" And to keep Zudocu comment characters.
-setlocal comments=sO:#\ -,mO:#\ \ ,:#=,:#-,:#%,:#
+setlocal comments=sO:#\ -,mO:#\ \ ,exO:#/,s:/*,m:\ ,ex:*/,:#=,:#-,:#%,:#
setlocal errorformat^=%f\ line\ %l\ col\ %c:\ %m,ERROR:\ %m
diff --git a/runtime/ftplugin/zsh.vim b/runtime/ftplugin/zsh.vim
index 34410f1c62..0ca8077305 100644
--- a/runtime/ftplugin/zsh.vim
+++ b/runtime/ftplugin/zsh.vim
@@ -2,7 +2,7 @@
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2020-09-01
+" Latest Revision: 2021-04-03
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
diff --git a/runtime/indent/json.vim b/runtime/indent/json.vim
index 09c7d7a85a..510f7e8f42 100644
--- a/runtime/indent/json.vim
+++ b/runtime/indent/json.vim
@@ -3,6 +3,7 @@
" Maintainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
" Last Change: 2020 Aug 30
" https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c
+" 2022 Sep 07: b:undo_indent added by Doug Kearns
" Original Author: Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json
" Acknowledgement: Based off of vim-javascript maintained by Darrick Wiebe
" http://www.vim.org/scripts/script.php?script_id=2765
@@ -22,6 +23,8 @@ setlocal nosmartindent
setlocal indentexpr=GetJSONIndent(v:lnum)
setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
+let b:undo_indent = "setl inde< indk< si<"
+
" Only define the function once.
if exists("*GetJSONIndent")
finish
diff --git a/runtime/syntax/gitattributes.vim b/runtime/syntax/gitattributes.vim
new file mode 100644
index 0000000000..b6d997f45d
--- /dev/null
+++ b/runtime/syntax/gitattributes.vim
@@ -0,0 +1,63 @@
+" Vim syntax file
+" Language: git attributes
+" Maintainer: ObserverOfTime <chronobserver@disroot.org>
+" Filenames: .gitattributes, *.git/info/attributes
+" Last Change: 2022 Sep 09
+
+if exists('b:current_syntax')
+ finish
+endif
+
+let s:cpo_save = &cpoptions
+set cpoptions&vim
+
+" Comment
+syn keyword gitattributesTodo contained TODO FIXME XXX
+syn match gitattributesComment /^\s*#.*/ contains=gitattributesTodo
+
+" Pattern
+syn match gitattributesPattern /^\s*#\@!\(".\+"\|\S\+\)/ skipwhite
+ \ nextgroup=gitattributesAttrPrefixed,gitattributesAttrAssigned skipwhite
+ \ contains=gitattributesGlob,gitattributesRange,gitattributesSeparator
+syn match gitattributesGlob /\\\@1<![?*]/ contained
+syn match gitattributesRange /\\\@1<!\[.\{-}\]/ contained
+syn match gitattributesSeparator '/' contained
+
+" Attribute
+syn match gitattributesAttrPrefixed /[!-]\?[A-Za-z0-9_.][-A-Za-z0-9_.]*/
+ \ transparent contained skipwhite
+ \ nextgroup=gitattributesAttrPrefixed,gitattributesAttrAssigned
+ \ contains=gitattributesPrefix,gitattributesName
+syn match gitattributesAttrAssigned /[A-Za-z0-9_.][-A-Za-z0-9_.]*=\S\+/
+ \ transparent contained skipwhite
+ \ nextgroup=gitattributesAttrPrefixed,gitattributesAttrAssigned
+ \ contains=gitattributesName,gitattributesAssign,gitattributesBoolean,gitattributesString
+syn match gitattributesName /[A-Za-z0-9_.][-A-Za-z0-9_.]*/
+ \ contained nextgroup=gitattributesAssign
+syn match gitattributesPrefix /[!-]/ contained
+ \ nextgroup=gitAttributesName
+syn match gitattributesAssign '=' contained
+ \ nextgroup=gitattributesBoolean,gitattributesString
+syn match gitattributesString /=\@1<=\S\+/ contained
+syn keyword gitattributesBoolean true false contained
+
+" Macro
+syn match gitattributesMacro /^\s*\[attr\]\s*\S\+/
+ \ nextgroup=gitattributesAttribute skipwhite
+