]> granicus.if.org Git - vim/commitdiff
Update runtime files.
authorBram Moolenaar <Bram@vim.org>
Mon, 28 Sep 2020 19:48:16 +0000 (21:48 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 28 Sep 2020 19:48:16 +0000 (21:48 +0200)
16 files changed:
runtime/compiler/shellcheck.vim [new file with mode: 0644]
runtime/doc/autocmd.txt
runtime/doc/eval.txt
runtime/doc/filetype.txt
runtime/doc/gui.txt
runtime/doc/popup.txt
runtime/doc/starting.txt
runtime/doc/tags
runtime/doc/todo.txt
runtime/doc/vim9.txt
runtime/filetype.vim
runtime/ftplugin/awk.vim
runtime/indent/vim.vim
runtime/syntax/man.vim
runtime/syntax/sh.vim
runtime/syntax/vim.vim

diff --git a/runtime/compiler/shellcheck.vim b/runtime/compiler/shellcheck.vim
new file mode 100644 (file)
index 0000000..7550439
--- /dev/null
@@ -0,0 +1,25 @@
+" Vim compiler file
+" Compiler:    ShellCheck
+" Maintainer:  Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2020 Sep 4
+
+if exists("current_compiler")
+  finish
+endif
+let current_compiler = "shellcheck"
+
+if exists(":CompilerSet") != 2         " older Vim always used :setlocal
+  command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+CompilerSet makeprg=shellcheck\ -f\ gcc
+CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m\ [SC%n],
+                      \%f:%l:%c:\ %tarning:\ %m\ [SC%n],
+                      \%f:%l:%c:\ %tote:\ %m\ [SC%n],
+                      \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
index d56f211d0d50bb2b9ccf08e40730a13c6e6867f2..9355d1f405e630a15a62b6a136633325c7a6cc6e 100644 (file)
@@ -1,4 +1,4 @@
-*autocmd.txt*   For Vim version 8.2.  Last change: 2020 Aug 02
+*autocmd.txt*   For Vim version 8.2.  Last change: 2020 Sep 25
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -631,7 +631,7 @@ CompleteDone                        After Insert mode completion is done.  Either
 
                                                        *CursorHold*
 CursorHold                     When the user doesn't press a key for the time
-                               specified with 'updatetime'.  Not re-triggered
+                               specified with 'updatetime'.  Not triggered
                                until the user has pressed a key (i.e. doesn't
                                fire every 'updatetime' ms if you leave Vim to
                                make some coffee. :)  See |CursorHold-example|
index 50e5995c6d95421d27b2f2542493a42a08f8ef05..58c390ebb4bc58bfe66112385490463b388375d1 100644 (file)
@@ -1,4 +1,4 @@
-*eval.txt*     For Vim version 8.2.  Last change: 2020 Sep 22
+*eval.txt*     For Vim version 8.2.  Last change: 2020 Sep 25
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -877,7 +877,7 @@ Example: >
 All expressions within one level are parsed from left to right.
 
 
-expr1                                                  *expr1* *E109*
+expr1                                                  *expr1* *trinary* *E109*
 -----
 
 expr2 ? expr1 : expr1
index 539b96eec79e8f7ebb8df55da96fe946905b9dfa..4eb746260e7352b9518715b14faecf59b7363c02 100644 (file)
@@ -1,4 +1,4 @@
-*filetype.txt*  For Vim version 8.2.  Last change: 2019 Jul 16
+*filetype.txt*  For Vim version 8.2.  Last change: 2020 Sep 28
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -397,6 +397,13 @@ ways to change this:
 3.  Docs for the default filetype plugins.             *ftplugin-docs*
 
 
+AWK                                                    *ft-awk-plugin*
+
+Support for features specific to GNU Awk, like @include, can be enabled by
+setting: >
+       let g:awk_is_gawk = 1
+
+
 CHANGELOG                                              *ft-changelog-plugin*
 
 Allows for easy entrance of Changelog entries in Changelog files.  There are
index 985fdea4946917b06cd019733142d1133c052f6f..ac8febebee3234f905bb57406dd99e3df25d325f 100644 (file)
@@ -1,4 +1,4 @@
-*gui.txt*       For Vim version 8.2.  Last change: 2020 Mar 16
+*gui.txt*       For Vim version 8.2.  Last change: 2020 Sep 28
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -547,15 +547,6 @@ floating menus that do not appear on the main menu bar.
 5.2 Creating New Menus                                 *creating-menus*
 
                                *:me*  *:menu*   *:noreme*  *:noremenu*
-                               *:am*  *:amenu*  *:an*      *:anoremenu*
-                               *:nme* *:nmenu*  *:nnoreme* *:nnoremenu*
-                               *:ome* *:omenu*  *:onoreme* *:onoremenu*
-                               *:vme* *:vmenu*  *:vnoreme* *:vnoremenu*
-                               *:xme* *:xmenu*  *:xnoreme* *:xnoremenu*
-                               *:sme* *:smenu*  *:snoreme* *:snoremenu*
-                               *:ime* *:imenu*  *:inoreme* *:inoremenu*
-                               *:cme* *:cmenu*  *:cnoreme* *:cnoremenu*
-                               *:tlm* *:tlmenu* *:tln*     *:tlnoremenu*
                                *E330* *E327* *E331* *E336* *E333*
                                *E328* *E329* *E337* *E792*
 To create a new menu item, use the ":menu" commands.  They are mostly like
@@ -596,6 +587,7 @@ With the shortcut "F" (while keeping the <Alt> key pressed), and then "O",
 this menu can be used.  The second part is shown as "Open     :e".  The ":e"
 is right aligned, and the "O" is underlined, to indicate it is the shortcut.
 
+                                       *:am*  *:amenu*  *:an*      *:anoremenu*
 The ":amenu" command can be used to define menu entries for all modes at once,
 except for Terminal mode.  To make the command work correctly, a character is
 automatically inserted for some modes:
@@ -634,6 +626,30 @@ included they make the <> form and raw key codes not being recognized).
 Note that <Esc> in Cmdline mode executes the command, like in a mapping.  This
 is Vi compatible.  Use CTRL-C to quit Cmdline mode.
 
+               *:nme* *:nmenu*  *:nnoreme* *:nnoremenu* *:nunme* *:nunmenu*
+Menu commands starting with "n" work in Normal mode. |mapmode-n|
+
+               *:ome* *:omenu*  *:onoreme* *:onoremenu* *:ounme* *:ounmenu*
+Menu commands starting with "o" work in Operator-pending mode. |mapmode-o|
+
+               *:vme* *:vmenu*  *:vnoreme* *:vnoremenu* *:vunme* *:vunmenu*
+Menu commands starting with "v" work in Visual mode. |mapmode-v|
+
+               *:xme* *:xmenu*  *:xnoreme* *:xnoremenu* *:xunme* *:xunmenu*
+Menu commands starting with "x" work in Visual and Select mode. |mapmode-x|
+
+               *:sme* *:smenu*  *:snoreme* *:snoremenu* *:sunme* *:sunmenu*
+Menu commands starting with "s" work in Select mode. |mapmode-s|
+
+               *:ime* *:imenu*  *:inoreme* *:inoremenu* *:iunme* *:iunmenu*
+Menu commands starting with "i" work in Insert mode. |mapmode-i|
+
+               *:cme* *:cmenu*  *:cnoreme* *:cnoremenu* *:cunme* *:cunmenu*
+Menu commands starting with "c" work in Cmdline mode. |mapmode-c|
+
+               *:tlm* *:tlmenu* *:tln*     *:tlnoremenu* *:tlu*   *:tlunmenu*
+Menu commands starting with "tl" work in Terminal mode. |mapmode-t|
+
                                                *:menu-<silent>* *:menu-silent*
 To define a menu which will not be echoed on the command line, add
 "<silent>" as the first argument.  Example: >
@@ -897,14 +913,6 @@ using the last visual selection.
 
                                                *:unme*  *:unmenu*
                                                *:aun*   *:aunmenu*
-                                               *:nunme* *:nunmenu*
-                                               *:ounme* *:ounmenu*
-                                               *:vunme* *:vunmenu*
-                                               *:xunme* *:xunmenu*
-                                               *:sunme* *:sunmenu*
-                                               *:iunme* *:iunmenu*
-                                               *:cunme* *:cunmenu*
-                                               *:tlu*   *:tlunmenu*
 To delete a menu item or a whole submenu, use the unmenu commands, which are
 analogous to the unmap commands.  Eg: >
     :unmenu! Edit.Paste
index 856132dad8bc3f87b8879eb71d0cf522e7d379b2..118bc9b09ca19c4f891fbc5a5e8b38a3b531e0f4 100644 (file)
@@ -1,4 +1,4 @@
-*popup.txt*  For Vim version 8.2.  Last change: 2020 Sep 08
+*popup.txt*  For Vim version 8.2.  Last change: 2020 Sep 27
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -711,7 +711,7 @@ The second argument of |popup_create()| is a dictionary with options:
                        By default a double line is used all around when
                        'encoding' is "utf-8" and 'ambiwidth' is "single",
                        otherwise ASCII characters are used.
-       scrollbar       non-zero: show a scrollbar when the text doesn't fit.
+       scrollbar       1 or true: show a scrollbar when the text doesn't fit.
                        zero: do not show a scrollbar.  Default is non-zero.
                        Also see |popup-scrollbar|.
        scrollbarhighlight  Highlight group name for the scrollbar. The
index f437c0e0346727d565a453d9beff50cb70a751c3..9014a420fa79e14c7fa4c9ba3eafcde2f51ce7ba 100644 (file)
@@ -1,4 +1,4 @@
-*starting.txt*  For Vim version 8.2.  Last change: 2020 Feb 04
+*starting.txt*  For Vim version 8.2.  Last change: 2020 Sep 23
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -513,6 +513,8 @@ a slash.  Thus "-R" means recovery and "-/R" readonly.
                  'nocompatible': use Vim defaults
                - no |gvimrc| script is loaded
                - no viminfo file is read or written
+               Note that a following "-u" argument overrules the effect of
+               "-u DEFAULTS".
 
                                                        *-x*
 -x             Use encryption to read/write files.  Will prompt for a key,
index b9d7e03c29cb52d74fd4adc0968f8d0693f8c063..49baae69d687bfd3c96e6f80bb8d3c0baa88db06 100644 (file)
@@ -6461,6 +6461,7 @@ ft-asm68k-syntax  syntax.txt      /*ft-asm68k-syntax*
 ft-asmh8300-syntax     syntax.txt      /*ft-asmh8300-syntax*
 ft-aspperl-syntax      syntax.txt      /*ft-aspperl-syntax*
 ft-aspvbs-syntax       syntax.txt      /*ft-aspvbs-syntax*
+ft-awk-plugin  filetype.txt    /*ft-awk-plugin*
 ft-bash-syntax syntax.txt      /*ft-bash-syntax*
 ft-basic-syntax        syntax.txt      /*ft-basic-syntax*
 ft-c-omni      insert.txt      /*ft-c-omni*
@@ -7756,6 +7757,7 @@ matcharg()        eval.txt        /*matcharg()*
 matchdelete()  eval.txt        /*matchdelete()*
 matchend()     eval.txt        /*matchend()*
 matchfuzzy()   eval.txt        /*matchfuzzy()*
+matchfuzzypos()        eval.txt        /*matchfuzzypos()*
 matchit-install        usr_05.txt      /*matchit-install*
 matchlist()    eval.txt        /*matchlist()*
 matchparen     pi_paren.txt    /*matchparen*
@@ -9649,6 +9651,7 @@ tooltips  gui.txt /*tooltips*
 toupper()      eval.txt        /*toupper()*
 tr()   eval.txt        /*tr()*
 trim() eval.txt        /*trim()*
+trinary        eval.txt        /*trinary*
 trojan-horse   starting.txt    /*trojan-horse*
 true   vim9.txt        /*true*
 true-variable  eval.txt        /*true-variable*
@@ -10040,6 +10043,7 @@ vim9-declaration        vim9.txt        /*vim9-declaration*
 vim9-declarations      usr_46.txt      /*vim9-declarations*
 vim9-differences       vim9.txt        /*vim9-differences*
 vim9-export    vim9.txt        /*vim9-export*
+vim9-final     vim9.txt        /*vim9-final*
 vim9-gotchas   vim9.txt        /*vim9-gotchas*
 vim9-import    vim9.txt        /*vim9-import*
 vim9-rationale vim9.txt        /*vim9-rationale*
index 03c9fcea405a6f438531808f514df27054ca1e0f..d47eccabe8060b44a71329fad67a4989e4aa64c4 100644 (file)
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 8.2.  Last change: 2020 Sep 19
+*todo.txt*      For Vim version 8.2.  Last change: 2020 Sep 28
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -38,14 +38,19 @@ browser use: https://github.com/vim/vim/issues/1234
                                                        *known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-Why does Test_invalid_sid() not work in the GUI?
+Popup windows: don't send any keys from ":normal" to popup filter?
+  Can drop ex_normal_busy_done then.
+
+Move Test_let_* from test_vim9_script to test_vim9_assign
+
+Modifiers in GTK: issue #6457.  CTRL-6 should work, like CTRL-@ and CTRL-_.
 
-Add matchfuzzy() and matchfuzzypos() Yegappan, #6947
-    should be ready now
+3 October: remove using :let in Vim9 script.
 
+Go back to not using string/list/dict as falsy/thruthy boolean?
+    or only make "||" and "&&" result in a boolean?
 Making everything work:
-- Fix memory leak in test_vim9_func (through compile_nested_function and
-  get_lambda_tv())
+- Fix memory leaks in test_vim9_assign, remove "if 0"
 - Fix memory leaks in test_vim9_script
 - At the Vim9 script level, keep script variables local to the block they are
   declared in, like in Javascript (using :let).
@@ -78,6 +83,7 @@ Making everything work:
 - Make sure that where a callback is expected a function can be used (without
   quotes). E.g. sort() and map().  Also at the script level.
 - assignment to more complex lval: list[1][2][3] = 8
+  Also "list[0] += value".  test in Test_assign_dict_unknown_type().
 - ":put" with ISN_PUT does not handle range correctly, e.g. ":$-2put".
   Add command to parse range at runtime?
 - Make map() give an error if the resulting type is wrong.
@@ -92,9 +98,10 @@ Making everything work:
 - ISN_CHECKTYPE could use check_argtype()
 - give error for variable name:
       let p = function('NoSuchFunc')
-- Give runtime error if function argument is wrong.
-       def Increment(nr: number)
-       range(3)->Increment()
+- If a :def function is called with a function reference, compile it to get
+  the function type.
+       def Filter(x: string, Cond: func(string): bool)
+       Filter(x, { v -> v =~ '^b' })
 - Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop
 - Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd
 - Expand `=expr` in :mkspell
@@ -122,6 +129,8 @@ Making everything work:
 - When evaluating constants for script variables, some functions could work:
     has('asdf'), len('string')
 - Implement "as Name" in "import Item as Name from ..."
+- Implement using imported items at script level from "import * as X" in
+  eval_variable().  Should pass the ".xxx" that follows and return that.
 - Disallow unlet for local/script/imported vars
 - Make "++nr" work.
 - Make closures work:
@@ -332,6 +341,8 @@ Make it possible to map (console and GUI):  #6457
 Patch for Template string: #4634
 Have another look at the implementation.
 
+Valgrind warns for uninitialized values in f_term_dumpwrite().
+
 Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr"
     replace this:
        let left = GetLeftFunc()
@@ -341,6 +352,8 @@ Add the <=> (spaceship) operator and "cond ?< expr ?= expr ?> expr"
        let res = GetLeftFunc() <=> GetRightFunc() ?< lower ?= equal ?> upper
 Patch to make :q work with local arglist. (Christian Brabandt, #6286)
 
+Why does Test_invalid_sid() not work in the GUI?
+
 Lua: updating wrong buffer when using newly created, unloaded buffer.
 (#6539)
 
index 4e5d2f3fef9ece9b636bf8ad659bdf325a1fe103..86879dde84f6503c667a30e18a20c839d92c2c88 100644 (file)
@@ -65,6 +65,35 @@ rewrite old scripts, they keep working as before.  You may want to use a few
 
 THIS IS STILL UNDER DEVELOPMENT - ANYTHING CAN BREAK - ANYTHING CAN CHANGE
 
+Overview ~
+
+Brief summary of the differences you will most often encounter when using Vim9
+script and `:def` functions; details are below:
+- Comments start with #, not ": >
+       echo "hello"   # comment
+- Using a backslash for line continuation is hardly ever needed: >
+       echo "hello "
+            .. yourName
+            .. ", how are you?"
+- White space is required in many places.
+- Assign values without `:let`, declare variables with `:var`: >
+       var count = 0
+       count += 3
+- Constants can be declared with `:final` and `:const`: >
+       final matches = []                # add matches
+       const names = ['Betty', 'Peter']  # cannot be changed
+- `:final` cannot be used as an abbreviation of `:finally`.
+- Variables and functions are script-local by default.
+- Functions are declared with argument types and return type: >
+       def CallMe(count: number, message: string): bool
+- Call functions without `:call`: >
+       writefile(['done'], 'file.txt')
+- You cannot use `:xit`, `:t`, `:append`, `:change`, `:insert` or curly-braces
+  names.
+- A range before a command must be prefixed with a colon: >
+       :%s/this/that
+
+
 Comments starting with # ~
 
 In legacy Vim script comments start with double quote.  In Vim9 script
index 65102dd46a215a4a8d342d087a84d45b8c7b50a4..ba1b79508c4beb8bd312a07cdbe7a5fb2e81bc4c 100644 (file)
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:  Bram Moolenaar <Bram@vim.org>
-" Last Change: 2020 Aug 04
+" Last Change: 2020 Sep 28
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -1203,7 +1203,7 @@ au BufNewFile,BufRead *.pod6                      setf pod6
 au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp      setf php
 
 " PHP config
-au BufNewFile,BufRead php.ini,php.ini-*                setf dosini
+au BufNewFile,BufRead php.ini-*                        setf dosini
 
 " Pike and Cmod
 au BufNewFile,BufRead *.pike,*.pmod            setf pike
index dcefc85ec30525e4aa856995e6ab09c52c32a770..9809fec38393de3811469a9dd99e659cb83f9353 100644 (file)
@@ -1,9 +1,10 @@
 " Vim filetype plugin
 " Language:    awk, nawk, gawk, mawk
 " Maintainer:  Antonio Colombo <azc100@gmail.com>
-" Last Change: 2017 Feb 17
+" Last Change: 2020 Sep 28
 
 " This plugin was prepared by Mark Sikora
+" This plugin was updated as proposed by Doug Kearns
 
 " Only do this when not done yet for this buffer
 if exists("b:did_ftplugin")
@@ -13,6 +14,42 @@ endif
 " Don't load another plugin for this buffer
 let b:did_ftplugin = 1
 
-let b:undo_ftplugin = "setl commentstring<"
+let s:cpo_save = &cpo
+set cpo&vim
 
+setlocal comments=:#
 setlocal commentstring=#\ %s
+setlocal formatoptions-=t formatoptions+=croql
+
+setlocal define=function
+setlocal suffixesadd+=.awk
+
+let b:undo_ftplugin = "setl fo< com< cms< def< sua<" .
+                   \ " | unlet! b:browsefilter"
+
+" TODO: set this in scripts.vim?
+if exists("g:awk_is_gawk")
+  setlocal include=@include
+  setlocal suffixesadd+=.gawk
+  if has("unix") || has("win32unix")
+    setlocal formatprg=gawk\ -f-\ -o/dev/stdout
+    let b:undo_ftplugin .= " | setl fp<"
+  endif
+
+  let path = system("gawk 'BEGIN { printf ENVIRON[\"AWKPATH\"] }'")
+  let path = substitute(path, '^\.\=:\|:\.\=$\|:\.\=:', ',,', 'g') " POSIX cwd
+  let path = substitute(path, ':', ',', 'g')
+
+  let &l:path = path
+  let b:undo_ftplugin .= " | setl inc< path<"
+endif
+
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
+  let b:browsefilter = "Awk Source Files (*.awk,*.gawk)\t*.awk;*.gawk\n" .
+                    \ "All Files (*.*)\t*.*\n"
+endif
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: nowrap sw=2 sts=2 ts=8
index 3809943388c79438efddc4dc2a6ebad89380aef6..4b0867d88a86fb5df198452941ae286c8922f013 100644 (file)
@@ -1,7 +1,7 @@
 " Vim indent file
 " Language:    Vim script
 " Maintainer:  Bram Moolenaar <Bram@vim.org>
-" Last Change: 2020 Jul 19
+" Last Change: 2020 Sep 27
 
 " Only load this indent file when no other was loaded.
 if exists("b:did_indent")
@@ -10,7 +10,7 @@ endif
 let b:did_indent = 1
 
 setlocal indentexpr=GetVimIndent()
-setlocal indentkeys+==end,=},=else,=cat,=fina,=END,0\\,0=\"\\\ 
+setlocal indentkeys+==end,=},=else,=cat,=finall,=END,0\\,0=\"\\\ 
 setlocal indentkeys-=0#
 
 let b:undo_indent = "setl indentkeys< indentexpr<"
@@ -93,7 +93,7 @@ function GetVimIndentIntern()
   else
     " A line starting with :au does not increment/decrement indent.
     if prev_text !~ '^\s*au\%[tocmd]'
-      let i = match(prev_text, '\(^\||\)\s*\({\|\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|def\|el\%[seif]\)\>\)')
+      let i = match(prev_text, '\(^\||\)\s*\(export\s\+\)\?\({\|\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\|finall\%[y]\|fu\%[nction]\|def\|el\%[seif]\)\>\)')
       if i >= 0
        let ind += shiftwidth()
        if strpart(prev_text, i, 1) == '|' && has('syntax_items')
@@ -117,7 +117,7 @@ function GetVimIndentIntern()
 
   " Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry,
   " :endfun, :enddef, :else and :augroup END.
-  if cur_text =~ '^\s*\(ene\@!\|}\|cat\|fina\|el\|aug\%[roup]\s\+[eE][nN][dD]\)'
+  if cur_text =~ '^\s*\(ene\@!\|}\|cat\|finall\|el\|aug\%[roup]\s\+[eE][nN][dD]\)'
     let ind = ind - shiftwidth()
   endif
 
index 56f6d10de2b2168ec70adc87d815a018c5a7543e..4e08cd7342666765b48894b04732ff114f236ff2 100644 (file)
@@ -4,7 +4,7 @@
 " Previous Maintainer: SungHyun Nam <goweol@gmail.com>
 " Previous Maintainer: Gautam H. Mudunuri <gmudunur@informatica.com>
 " Version Info:
-" Last Change: 2020 Apr 30
+" Last Change: 2020 Sep 19
 
 " Additional highlighting by Johannes Tanzler <johannes.tanzler@aon.at>:
 "      * manSubHeading
@@ -21,8 +21,8 @@ runtime! syntax/ctrlh.vim
 syn case ignore
 
 syn match  manReference       "\f\+([1-9][a-z]\=)"
-syn match  manSectionHeading  "^[a-z][a-z -]*[a-z]$"
-syn match  manSubHeading      "^\s\{3\}[a-z][a-z -]*[a-z]$"
+syn match  manSectionHeading  "^\a.*$"
+syn match  manSubHeading      "^\s\{3\}\a.*$"
 syn match  manOptionDesc      "^\s*[+-][a-z0-9]\S*"
 syn match  manLongOptionDesc  "^\s*--[a-z0-9-]\S*"
 " syn match  manHistory                "^[a-z].*last change.*$"
index 3a2a6e7b0e4ced343946c097ea2268d923e83de2..b66805633d5c6fa4bcb201e60406e9b4dbf77b47 100644 (file)
@@ -2,8 +2,8 @@
 " Language:            shell (sh) Korn shell (ksh) bash (sh)
 " Maintainer:          Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
 " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
-" Last Change:         Apr 14, 2020
-" Version:             190
+" Last Change:         Aug 10, 2020
+" Version:             193
 " URL:         http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
 " For options and settings, please use:      :help ft-sh-syntax
 " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr)
@@ -20,8 +20,8 @@ if getline(1) =~ '\<ksh$'
 elseif getline(1) =~ '\<bash$'
  let b:is_bash      = 1
 elseif getline(1) =~ '\<dash$'
- let b:is_posix     = 1
-elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh")
+ let b:is_dash      = 1
+elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") && !exists("g:is_dash")
  let s:shell = ""
  if executable("/bin/sh")
   let s:shell = resolve("/bin/sh")
@@ -33,7 +33,7 @@ elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix"
  elseif s:shell =~ 'bash$'
   let b:is_bash = 1
  elseif s:shell =~ 'dash$'
-  let b:is_posix = 1
+  let b:is_dash = 1
  endif
  unlet s:shell
 endif
@@ -45,7 +45,7 @@ endif
 " So, when the user sets "g:is_bash", "g:is_kornshell",
 " or "g:is_posix", a b:is_sh is converted into b:is_bash/b:is_kornshell,
 " respectively.
-if !exists("b:is_kornshell") && !exists("b:is_bash")
+if !exists("b:is_kornshell") && !exists("b:is_bash") && !exists("b:is_dash")
   if exists("g:is_posix") && !exists("g:is_kornshell")
    let g:is_kornshell= g:is_posix
   endif
@@ -59,11 +59,21 @@ if !exists("b:is_kornshell") && !exists("b:is_bash")
     if exists("b:is_sh")
       unlet b:is_sh
     endif
+  elseif exists("g:is_dash")
+    let b:is_dash= 1
+    if exists("b:is_sh")
+      unlet b:is_sh
+    endif
   else
     let b:is_sh= 1
   endif
 endif
 
+" if b:is_dash, set b:is_posix too
+if exists("b:is_dash")
+ let b:is_posix= 1
+endif
+
 " set up default g:sh_fold_enabled {{{1
 " ================================
 if !exists("g:sh_fold_enabled")
@@ -133,7 +143,7 @@ syn cluster shCurlyList     contains=shNumber,shComma,shDeref,shDerefSimple,shDerefS
 " COMBAK: removing shEscape fromshDblQuoteList fails ksh04:43
 syn cluster shDblQuoteList     contains=shArithmetic,shCommandSub,shCommandSubBQ,shDeref,shDerefSimple,shPosnParm,shCtrlSeq,shSpecial,shSpecialDQ
 syn cluster shDerefList        contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS
-syn cluster shDerefVarList     contains=shDerefOff,shDerefOp,shDerefVarArray,shDerefOpError
+syn cluster shDerefVarList     contains=shDerefOffset,shDerefOp,shDerefVarArray,shDerefOpError
 syn cluster shEchoList contains=shArithmetic,shCommandSub,shCommandSubBQ,shDeref,shDerefSimple,shEscape,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote
 syn cluster shExprList1        contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq
 syn cluster shExprList2        contains=@shExprList1,@shCaseList,shTest
@@ -358,7 +368,7 @@ elseif !exists("g:sh_no_error")
 endif
 syn region  shSingleQuote      matchgroup=shQuote start=+'+ end=+'+            contains=@Spell nextgroup=shSpecialStart,shSpecialSQ
 syn region  shDoubleQuote      matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@<!"+ skip=+\\.+ end=+"+    contains=@shDblQuoteList,shStringSpecial,@Spell nextgroup=shSpecialStart
-syn region  shDoubleQuote      matchgroup=shQuote start=+"+ matchgroup=shSpecial skip=+\\"+ end=+"+            contained       contains=@shDblQuoteList,shStringSpecial,@Spell nextgroup=shSpecialStart
+syn region  shDoubleQuote      matchgroup=shQuote start=+"+ matchgroup=shSpecial skip=+\\"+ matchgroup=shQuote end=+"+         contained       contains=@shDblQuoteList,shStringSpecial,@Spell nextgroup=shSpecialStart
 syn match   shStringSpecial    "[^[:print:] \t]"                       contained
 syn match   shStringSpecial    "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]"                       nextgroup=shComment
 syn match   shSpecialSQ        "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]"               contained       nextgroup=shBkslshSnglQuote,@shNoZSList
@@ -424,6 +434,9 @@ if exists("b:is_bash")
  syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\)\>[/a-zA-Z_]\@!" end="\ze[;|#)]\|$"             matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+="       contains=@shIdList nextgroup=shComment
 elseif exists("b:is_kornshell") || exists("b:is_posix")
  syn match  shSet "^\s*set\ze\s\+$"
+ if exists("b:is_dash")
+  syn region shSetList oneline matchgroup=shSet start="\<\%(local\)\>\ze[/]\@!" end="$"                         matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]"   contains=@shIdList
+ endif
  syn region shSetList oneline matchgroup=shSet start="\<\(export\)\>\ze[/]\@!" end="$"         matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]"    contains=@shIdList
  syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\>\)\ze[/a-zA-Z_]\@!" end="\ze[;|#)]\|$"          matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]"    contains=@shIdList nextgroup=shComment
 else
@@ -471,14 +484,14 @@ endif
 " bash: ${!prefix*} and ${#parameter}: {{{1
 " ====================================
 if exists("b:is_bash")
- syn region shDeref    matchgroup=PreProc start="\${!" end="\*\=}"     contains=@shDerefList,shDerefOff
+ syn region shDeref    matchgroup=PreProc start="\${!" end="\*\=}"     contains=@shDerefList,shDerefOffset
  syn match  shDerefVar contained       "{\@<=!\h\w*"           nextgroup=@shDerefVarList
 endif
 if exists("b:is_kornshell")
  syn match  shDerefVar contained       "{\@<=!\h\w*[[:alnum:]_.]*"     nextgroup=@shDerefVarList
 endif
 
-syn match  shDerefSpecial      contained       "{\@<=[-*@?0]"          nextgroup=shDerefOp,shDerefOpError
+syn match  shDerefSpecial      contained       "{\@<=[-*@?0]"          nextgroup=shDerefOp,shDerefOffset,shDerefOpError
 syn match  shDerefSpecial      contained       "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp
 syn match  shDerefVar  contained       "{\@<=\h\w*"            nextgroup=@shDerefVarList
 syn match  shDerefVar  contained       '\d'                            nextgroup=@shDerefVarList
@@ -502,6 +515,7 @@ syn region  shDerefVarArray   contained     matchgroup=shDeref start="\[" end="]"   co
 "        bash : ${parameter^^pattern} Case modification
 "        bash : ${parameter,pattern}  Case modification
 "        bash : ${parameter,,pattern} Case modification
+"        bash : ${@:start:qty}        display command line arguments from start to start+qty-1 (inferred)
 syn cluster shDerefPatternList contains=shDerefPattern,shDerefString
 if !exists("g:sh_no_error")
  syn match shDerefOpError      contained       ":[[:punct:]]"
@@ -522,17 +536,19 @@ syn region shDerefString  contained       matchgroup=shDerefDelim start=+\%(\\\)\@<!'+
 syn region shDerefString       contained       matchgroup=shDerefDelim start=+\%(\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial
 syn match  shDerefString       contained       "\\["']"        nextgroup=shDerefPattern
 
-if exists("b:is_bash")
- " bash : ${parameter:offset}
- " bash : ${parameter:offset:length}
- syn region shDerefOff contained       start=':[^-=?+]' end='\ze:'     end='\ze}'      contains=shDeref,shDerefSimple,shDerefEscape    nextgroup=shDerefLen,shDeref,shDerefSimple
- syn region shDerefOff contained       start=':\s-'    end='\ze:'      end='\ze}'      contains=shDeref,shDerefSimple,shDerefEscape    nextgroup=shDerefLen,shDeref,shDerefSimple
+if exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix")
+ " bash ksh posix : ${parameter:offset}
+ " bash ksh posix : ${parameter:offset:length}
+ syn region shDerefOffset      contained       start=':[^-=?+]' end='\ze:'     end='\ze}'      contains=shDeref,shDerefSimple,shDerefEscape    nextgroup=shDerefLen,shDeref,shDerefSimple
+ syn region shDerefOffset      contained       start=':\s-'    end='\ze:'      end='\ze}'      contains=shDeref,shDerefSimple,shDerefEscape    nextgroup=shDerefLen,shDeref,shDerefSimple
  syn match  shDerefLen contained       ":[^}]\+"       contains=shDeref,shDerefSimple,shArithmetic
+endif
 
+if exists("b:is_bash")
  " bash : ${parameter//pattern/string}
  " bash : ${parameter//pattern}
  syn match  shDerefPPS contained       '/\{1,2}'       nextgroup=shDerefPPSleft
- syn region shDerefPPSleft     contained       start='.'       skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp       end='/' end='\ze}'      nextgroup=shDerefPPSright       contains=@shPPSLeftList
+ syn region shDerefPPSleft     contained       start='.'       skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp       end='/' end='\ze}' end='"'      nextgroup=shDerefPPSright       contains=@shPPSLeftList
  syn region shDerefPPSright    contained       start='.'       skip=@\%(\\\\\)\+@              end='\ze}'                              contains=@shPPSRightList
 
  " bash : ${parameter/#substring/replacement}
@@ -675,8 +691,8 @@ if !exists("skip_sh_syntax_inits")
    hi def link bashSpecialVariables    shShellVariables
    hi def link bashStatement           shStatement
    hi def link shCharClass             shSpecial
-   hi def link shDerefOff              shDerefOp
-   hi def link shDerefLen              shDerefOff
+   hi def link shDerefOffset           shDerefOp
+   hi def link shDerefLen              shDerefOffset
  endif
  if exists("b:is_kornshell") || exists("b:is_posix")
    hi def link kshSpecialVariables     shShellVariables
index 9b20392fa220407adfac19977f6b6ee933336ea6..d4dab09d4366924edea1e9c600c3d0b73454fde8 100644 (file)
@@ -1,8 +1,8 @@
 " Vim syntax file
 " Language:    Vim 8.0 script
 " Maintainer:  Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: July 15, 2020
-" Version:     8.0-41
+" Last Change: Aug 30, 2020
+" Version:     8.0-43
 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
 " Automatically generated keyword lists: {{{1
 
@@ -236,7 +236,7 @@ endif
 " Functions : Tag is provided for those who wish to highlight tagged functions {{{2
 " =========
 syn cluster    vimFuncList     contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
-syn cluster    vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
+syn cluster    vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimEnvvar,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
 syn match      vimFunction     "\<\(fu\%[nction]\|def\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*("  contains=@vimFuncList nextgroup=vimFuncBody
 
 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
@@ -266,7 +266,7 @@ syn match   vimSpecFileMod  "\(:[phtre]\)\+"        contained
 " =======================
 syn cluster    vimUserCmdList  contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimFuncName,vimFunction,vimFunctionError,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine
 syn keyword    vimUserCommand  contained       com[mand]
-syn match      vimUserCmd      "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList
+syn match      vimUserCmd      "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter
 syn match      vimUserAttrbError       contained       "-\a\+\ze\s"
 syn match      vimUserAttrb    contained       "-nargs=[01*?+]"        contains=vimUserAttrbKey,vimOper
 syn match      vimUserAttrb    contained       "-complete="            contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError
@@ -295,12 +295,13 @@ syn match vimComment      +\<endif\s\+".*$+lc=5   contains=@vimCommentGroup,vimCommentS
 syn match      vimComment      +\<else\s\+".*$+lc=4    contains=@vimCommentGroup,vimCommentString
 syn region     vimCommentString        contained oneline start='\S\s\+"'ms=e   end='"'
 " Vim9 comments - TODO: might be highlighted while they don't work
-syn match      vim9Comment     excludenl +^#[^{].*$+   contains=@vimCommentGroup,vimCommentString
 syn match      vim9Comment     excludenl +\s#[^{].*$+lc=1      contains=@vimCommentGroup,vimCommentString
 syn match      vim9Comment     +\<endif\s\+#[^{].*$+lc=5       contains=@vimCommentGroup,vimCommentString
 syn match      vim9Comment     +\<else\s\+#[^{].*$+lc=4        contains=@vimCommentGroup,vimCommentString
 " Vim9 comment inside expression
 syn match      vim9Comment     +\s\zs#[^{].*$+ms=s+1   contains=@vimCommentGroup,vimCommentString
+syn match      vim9Comment     +^\s*#[^{].*$+  contains=@vimCommentGroup,vimCommentString
+syn match      vim9Comment     +^\s*#$+        contains=@vimCommentGroup,vimCommentString
 
 " Environment Variables: {{{2
 " =====================
@@ -370,7 +371,8 @@ syn match   vimAddress      ",\zs[.$]"      skipwhite nextgroup=vimSubst1
 syn match      vimAddress      "%\ze\a"        skipwhite nextgroup=vimString,vimSubst1
 
 syn match      vimFilter               "^!!\=[^"]\{-}\(|\|\ze\"\|$\)"  contains=vimOper,vimSpecFile
-syn match      vimFilter contained     "!!\=[^"]\{-}\(|\|\ze\"\|$\)"   contains=vimOper,vimSpecFile
+syn match      vimFilter    contained  "!!\=[^"]\{-}\(|\|\ze\"\|$\)"   contains=vimOper,vimSpecFile
+syn match      vimComFilter contained  "|!!\=[^"]\{-}\(|\|\ze\"\|$\)"      contains=vimOper,vimSpecFile
 
 " Complex Repeats: (:h complex-repeat) {{{2
 " ===============
@@ -386,7 +388,7 @@ syn match   vimSetMod       contained       "&vim\=\|[!&?<]\|all&"
 
 " Let: {{{2
 " ===
-syn keyword    vimLet  let     unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc
+syn keyword    vimLet  let var unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc
 VimFoldh syn region vimLetHereDoc      matchgroup=vimLetHereDocStart start='=<<\s\+\%(trim\>\)\=\s*\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$'  contains=vimComment,vim9Comment
 
 " Abbreviations: {{{2
@@ -397,8 +399,9 @@ syn keyword vimAbb  ab[breviate] ca[bbrev] inorea[bbrev] cnorea[bbrev] norea[bbre
 " =======
 syn match      vimAutoEventList        contained       "\(!\s\+\)\=\(\a\+,\)*\a\+"     contains=vimAutoEvent nextgroup=vimAutoCmdSpace
 syn match      vimAutoCmdSpace contained       "\s\+"  nextgroup=vimAutoCmdSfxList
-syn match      vimAutoCmdSfxList       contained       "\S*"
+syn match      vimAutoCmdSfxList       contained       "\S*"   skipwhite nextgroup=vimAutoCmdMod
 syn keyword    vimAutoCmd      au[tocmd] do[autocmd] doautoa[ll]       skipwhite nextgroup=vimAutoEventList
+syn match      vimAutoCmdMod   "\(++\)\=\(once\|nested\)"
 
 " Echo And Execute: -- prefer strings! {{{2
 " ================
@@ -634,7 +637,7 @@ syn match   vimCtrlChar     "[\ 1-\b\v\ f-\1f]"
 " Beginners - Patterns that involve ^ {{{2
 " =========
 syn match      vimLineComment  +^[ \t:]*".*$+  contains=@vimCommentGroup,vimCommentString,vimCommentTitle
-syn match      vim9LineComment +^[ \t:]*#.*$+  contains=@vimCommentGroup,vimCommentString,vimCommentTitle
+syn match      vim9LineComment +^[ \t]*#.*$+   contains=@vimCommentGroup,vimCommentString,vimCommentTitle
 syn match      vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1    contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
 syn match      vimContinue     "^\s*\\"
 syn region     vimString       start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
@@ -861,6 +864,7 @@ if !exists("skip_vim_syntax_inits")
  hi def link vimAutoCmdOpt     vimOption
  hi def link vimAutoCmd        vimCommand
  hi def link vimAutoEvent      Type
+ hi def link vimAutoCmdMod     Special
  hi def link vimAutoSet        vimCommand
  hi def link vimBehaveModel    vimBehave
  hi def link vimBehave vimCommand