diff options
33 files changed, 15253 insertions, 8645 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1b7961d281..2f46160851 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -126,6 +126,8 @@ runtime/ftplugin/tmux.vim @ericpruitt runtime/ftplugin/toml.vim @averms runtime/ftplugin/typescript.vim @dkearns runtime/ftplugin/typescriptreact.vim @dkearns +runtime/ftplugin/wget.vim @dkearns +runtime/ftplugin/wget2.vim @dkearns runtime/ftplugin/xml.vim @chrisbra runtime/ftplugin/zsh.vim @chrisbra runtime/indent/basic.vim @dkearns @@ -268,6 +270,7 @@ runtime/syntax/tmux.vim @ericpruitt runtime/syntax/toml.vim @averms runtime/syntax/vim.vim @cecamp runtime/syntax/wget.vim @dkearns +runtime/syntax/wget2.vim @dkearns runtime/syntax/xbl.vim @dkearns runtime/syntax/xmath.vim @cecamp runtime/syntax/xml.vim @chrisbra diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index acd0f5caa3..cd66041026 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 8.2. Last change: 2022 Apr 25 +*builtin.txt* For Vim version 8.2. Last change: 2022 May 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2425,7 +2425,7 @@ feedkeys({string} [, {mode}]) *feedkeys()* all typeahead will be consumed by the last call. 'c' Remove any script context when executing, so that legacy script syntax applies, "s:var" does not work, - etc. Note that if the keys being using set a script + etc. Note that if the string being fed sets a script context this still applies. '!' When used with 'x' will not end Insert mode. Can be used in a test when a timer is set to exit Insert mode diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index ff6995d000..d3e0a9ca1b 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 8.2. Last change: 2022 Mar 05 +*change.txt* For Vim version 8.2. Last change: 2022 May 07 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 8b491345aa..b2928a5e81 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 8.2. Last change: 2022 Apr 09 +*cmdline.txt* For Vim version 8.2. Last change: 2022 Apr 29 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 39208e48dc..ac61023612 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.2. Last change: 2022 Apr 17 +*eval.txt* For Vim version 8.2. Last change: 2022 May 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -523,8 +523,8 @@ only appear once. Examples: > A key is always a String. You can use a Number, it will be converted to a String automatically. Thus the String '4' and the number 4 will find the same entry. Note that the String '04' and the Number 04 are different, since the -Number will be converted to the String '4'. The empty string can also be used -as a key. +Number will be converted to the String '4', leading zeros are dropped. The +empty string can also be used as a key. In |Vim9| script literaly keys can be used if the key consists of alphanumeric characters, underscore and dash, see |vim9-literal-dict|. @@ -534,7 +534,8 @@ legacy script. This does require the key to consist only of ASCII letters, digits, '-' and '_'. Example: > :let mydict = #{zero: 0, one_key: 1, two-key: 2, 333: 3} Note that 333 here is the string "333". Empty keys are not possible with #{}. -In |Vim9| script the #{} form cannot be used. +In |Vim9| script the #{} form cannot be used because it can be confused with +the start of a comment. A value can be any expression. Using a Dictionary for a value creates a nested Dictionary: > @@ -3252,20 +3253,20 @@ text... {endmarker}. If "eval" is not specified, then each line of text is - used as a |literal-string|. If "eval" is specified, - then any Vim expression in the form ``={expr}`` is - evaluated and the result replaces the expression. + used as a |literal-string|, except that single quotes + doe not need to be doubled. + If "eval" is specified, then any Vim expression in the + form {expr} is evaluated and the result replaces the + expression, like with |interp-string|. Example where $HOME is expanded: > let lines =<< trim eval END some text - See the file `=$HOME`/.vimrc + See the file {$HOME}/.vimrc more text END < There can be multiple Vim expressions in a single line but an expression cannot span multiple lines. If any expression evaluation fails, then the assignment fails. - once the "`=" has been found {expr} and a backtick - must follow. {expr} cannot be empty. {endmarker} must not contain white space. {endmarker} cannot start with a lower case character. @@ -3318,10 +3319,10 @@ text... DATA let code =<< trim eval CODE - let v = `=10 + 20` - let h = "`=$HOME`" - let s = "`=Str1()` abc `=Str2()`" - let n = `=MyFunc(3, 4)` + let v = {10 + 20} + let h = "{$HOME}" + let s = "{Str1()} abc {Str2()}" + let n = {MyFunc(3, 4)} CODE < *E121* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 124cfee5e0..8668233411 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 8.2. Last change: 2022 Apr 13 +*options.txt* For Vim version 8.2. Last change: 2022 May 07 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index f8b5cacef6..09549b50bb 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 8.2. Last change: 2022 Apr 06 +*quickref.txt* For Vim version 8.2. Last change: 2022 May 05 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1350,7 +1350,7 @@ Context-sensitive completion on the command-line: |CTRL-W_^| CTRL-W ^ split window and edit alternate file |CTRL-W_n| CTRL-W n or :new create new empty window |CTRL-W_q| CTRL-W q or :q[uit] quit editing and close window -|CTRL-W_c| CTRL-W c or :cl[ose] make buffer hidden and close window +|CTRL-W_c| CTRL-W c or :clo[se] make buffer hidden and close window |CTRL-W_o| CTRL-W o or :on[ly] make current window only one on the screen diff --git a/runtime/doc/scroll.txt b/runtime/doc/scroll.txt index 0126195155..8035d3cfd9 100644 --- a/runtime/doc/scroll.txt +++ b/runtime/doc/scroll.txt @@ -1,4 +1,4 @@ -*scroll.txt* For Vim version 8.2. Last change: 2022 Apr 03 +*scroll.txt* For Vim version 8.2. Last change: 2022 May 07 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index e0919b84ff..9e9a0f166d 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 8.2. Last change: 2022 Apr 24 +*syntax.txt* For Vim version 8.2. Last change: 2022 May 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -5238,6 +5238,9 @@ These are the default highlighting groups. These groups are used by the 'highlight' option default. Note that the highlighting depends on the value of 'background'. You can see the current settings with the ":highlight" command. +When possible the name is highlighted in the used colors. If this makes it +unreadable use Visual selection. + *hl-ColorColumn* ColorColumn used for the columns set with 'colorcolumn' *hl-Conceal* @@ -5329,6 +5332,8 @@ Search Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out. *hl-CurSearch* CurSearch Current match for the last search pattern (see 'hlsearch'). + Note: this is correct after a search, but may get outdated if + changes are made or the screen is redrawn. *hl-SpecialKey* SpecialKey Meta and special keys listed with ":map", also for text used to show unprintable characters in the text, 'listchars'. diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 1a84eb425f..5bf28e2504 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.2. Last change: 2022 Apr 27 +*todo.txt* For Vim version 8.2. Last change: 2022 May 07 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41,7 +41,6 @@ browser use: https://github.com/vim/vim/issues/1234 Once Vim9 is stable: - Use Vim9 for more runtime files. - Check code coverage, add more tests if needed. - vim9execute.c line 3500 vim9expr.c vim9instr.c vim9script.c @@ -128,6 +127,9 @@ Text properties: - Popup attached to text property stays visible when text is deleted with "cc". (#7737) "C" works OK. "dd" also files in a buffer with a single line. +- Add text property that shifts text to make room for annotation (e.g. + variable type). Like the opposite of conceal. Requires fixing the cursor + positioning and mouse clicks as with conceal mode. - Auto-indenting may cause highlighting to shift. (#7719) - "cc" does not call inserted_bytes(). (Axel Forsman, #5763) - Combining text property with 'cursorline' does not always work (Billie @@ -152,6 +154,7 @@ Terminal debugger: - Make prompt-buffer variant work better. - Add option to not open the program window. It's not used when attaching to an already running program. (M. Kelly) +- Use the optional token on requests, match the result with it. #10300 - When only gdb window exists, on "quit" edit another buffer. - Termdebug does not work when Vim was built with mzscheme: gdb hangs just after "run". Everything else works, including communication channel. Not @@ -203,7 +206,11 @@ Terminal emulator window: - When 'encoding' is not utf-8, or the job is using another encoding, setup conversions. +String interpolation: Handle backslash and quotes in the expression normally, +do not require escaping. + Add autocmd functions. PR #10291 + a couple of outstanding comments, wait for Yegappan to respond Can deref_func_name() and deref_function_name() be merged? @@ -223,9 +230,6 @@ pass it on with modifications. Test_communicate_ipv6(): is flaky on many systems Fails in line 64 of Ch_communicate, no exception is thrown. -Patch for Template string: #4634 -Have another look at the implementation. - Rename getdigraphlist -> digraph_getlist() etc. Can "CSI nr X" be used instead of outputting spaces? Is it faster? #8002 @@ -328,6 +332,8 @@ Missing filetype test for bashrc, PKGBUILD, etc. Add an option to not fetch terminal codes in xterm, to avoid flicker when t_Co changes. +Add ??= operator, "a ??= b" works like "a = a ?? b". #10343 + Add an option to start_timer() to return from the input loop with K_IGNORE. This is useful e.g. when a popup was created that disables mappings, we need to return from vgetc() to make this happen. #7011 diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index adf03537b4..1877129041 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 8.2. Last change: 2022 Apr 14 +*vim9.txt* For Vim version 8.2. Last change: 2022 Apr 28 VIM REFERENCE MANUAL by Bram Moolenaar @@ -857,10 +857,16 @@ like in JavaScript: > var dict = {["key" .. nr]: value} The key type can be string, number, bool or float. Other types result in an -error. A number can be given with and without the []: > - var dict = {123: 'without', [456]: 'with'} +error. Without using [] the value is used as a string, keeping leading zeros. +An expression given with [] is evaluated and then converted to a string. +Leading zeros will then be dropped: > + var dict = {000123: 'without', [000456]: 'with'} echo dict - {'456': 'with', '123': 'without'} + {'456': 'with', '000123': 'without'} +A float only works inside [] because the dot is not accepted otherwise: > + var dict = {[00.013]: 'float'} + echo dict + {'0.013': 'float'} No :xit, :t, :k, :append, :change or :insert ~ diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt index e9862b1b2c..d703d986c2 100644 --- a/runtime/doc/visual.txt +++ b/runtime/doc/visual.txt @@ -1,4 +1,4 @@ -*visual.txt* For Vim version 8.2. Last change: 2022 Jan 20 +*visual.txt* For Vim version 8.2. Last change: 2022 May 06 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/ftplugin/wget.vim b/runtime/ftplugin/wget.vim new file mode 100644 index 0000000000..7a10221824 --- /dev/null +++ b/runtime/ftplugin/wget.vim @@ -0,0 +1,29 @@ +" Vim filetype plugin file +" Language: Wget configuration file (/etc/wgetrc ~/.wgetrc) +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2022 Apr 28 + +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 fo< com< cms<" + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Wget Configuration File (wgetrc, .wgetrc)\twgetrc;.wgetrc\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 diff --git a/runtime/ftplugin/wget2.vim b/runtime/ftplugin/wget2.vim new file mode 100644 index 0000000000..a6845f6df5 --- /dev/null +++ b/runtime/ftplugin/wget2.vim @@ -0,0 +1,29 @@ +" Vim filetype plugin file +" Language: Wget2 configuration file (/etc/wget2rc ~/.wget2rc) +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2022 Apr 28 + +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 fo< com< cms<" + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Wget2 Configuration File (wget2rc, .wget2rc)\twget2rc;.wget2rc\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 diff --git a/runtime/gvim.desktop b/runtime/gvim.desktop index 3c5ff1ce45..d25a04fbef 100644 --- a/runtime/gvim.desktop +++ b/runtime/gvim.desktop @@ -12,6 +12,7 @@ Name[it]=GVim Name[ru]=GVim Name[sr]=GVim Name[tr]=GVim +Name[uk]=GVim Name=GVim # Translators: This is the Generic Application Name used in the Vim desktop file GenericName[ca]=Editor de text @@ -25,6 +26,7 @@ GenericName[ja]=テキストエディタ GenericName[ru]=Текстовый редактор GenericName[sr]=Едитор текст GenericName[tr]=Metin Düzenleyici +GenericName[uk]=Редактор Тексту GenericName=Text Editor # Translators: This is the comment used in the Vim desktop file Comment[ca]=Edita fitxers de text @@ -38,6 +40,7 @@ Comment[ja]=テキストファイルを編集します Comment[ru]=Редактирование текстовых файлов Comment[sr]=Уређујте текст фајлове Comment[tr]=Metin dosyaları düzenleyin +Comment[uk]=Редагувати текстові файли Comment=Edit text files # The translations should come from the po file. Leave them here for now, they will # be overwritten by the po file when generating the desktop.file! @@ -97,9 +100,8 @@ Comment[sv]=Redigera textfiler Comment[ta]=உரை கோப்புகளை தொகுக்கவும் Comment[th]=แก้ไขแฟ้มข้อความ Comment[tk]=Metin faýllary editle -Comment[uk]=Редактор текстових файлів Comment[vi]=Soạn thảo tập tin văn bản -Comment[wa]=Asspougnî des fitchîs tecses +Comment[wa]=Asspougnî des fitcs tecses Comment[zh_CN]=编辑文本文件 Comment[zh_TW]=編輯文字檔 TryExec=gvim @@ -118,6 +120,7 @@ Keywords[ja]=テキスト;エディタ; Keywords[ru]=текст;текстовый редактор; Keywords[sr]=Текст;едитор; Keywords[tr]=Metin;düzenleyici; +Keywords[uk]=текст;редактор; Keywords=Text;editor; # Translators: This is the Icon file name. Do NOT translate Icon=gvim diff --git a/runtime/indent/testdir/yaml.in b/runtime/indent/testdir/yaml.in index 32ddc60956..bf99668da2 100644 --- a/runtime/indent/testdir/yaml.in +++ b/runtime/indent/testdir/yaml.in @@ -14,11 +14,6 @@ map: val # END_INDENT # START_INDENT -map: multiline -value -# END_INDENT - -# START_INDENT map: | line1 line2 diff --git a/runtime/indent/testdir/yaml.ok b/runtime/indent/testdir/yaml.ok index becdb1bae1..8b38633e71 100644 --- a/runtime/indent/testdir/yaml.ok +++ b/runtime/indent/testdir/yaml.ok @@ -14,11 +14,6 @@ map: val # END_INDENT # START_INDENT -map: multiline - value -# END_INDENT - -# START_INDENT map: | line1 line2 diff --git a/runtime/indent/yaml.vim b/runtime/indent/yaml.vim index ed57e68d8b..1f798416ed 100644 --- a/runtime/indent/yaml.vim +++ b/runtime/indent/yaml.vim @@ -2,7 +2,7 @@ " Language: YAML " Maintainer: Nikolai Pavlov <zyx.vim@gmail.com> " Last Update: Lukas Reineke -" Last Change: 2021 Aug 13 +" Last Change: 2022 May 02 " Only load this indent file when no other was loaded. if exists('b:did_indent') @@ -54,7 +54,7 @@ let s:c_ns_anchor_name = s:c_ns_anchor_char.'+' let s:c_ns_anchor_property = '\v\&'.s:c_ns_anchor_name let s:ns_word_char = '\v[[:alnum:]_\-]' -let s:ns_tag_char = '\v%('.s:ns_word_char.'|[#/;?:@&=+$.~*''()])' +let s:ns_tag_char = '\v%(%\x\x|'.s:ns_word_char.'|[#/;?:@&=+$.~*''()])' let s:c_named_tag_handle = '\v\!'.s:ns_word_char.'+\!' let s:c_secondary_tag_handle = '\v\!\!' let s:c_primary_tag_handle = '\v\!' @@ -63,7 +63,7 @@ let s:c_tag_handle = '\v%('.s:c_named_tag_handle. \ '|'.s:c_primary_tag_handle.')' let s:c_ns_shorthand_tag = '\v'.s:c_tag_handle . s:ns_tag_char.'+' let s:c_non_specific_tag = '\v\!' -let s:ns_uri_char = '\v%('.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])' +let s:ns_uri_char = '\v%(%\x\x|'.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])' let s:c_verbatim_tag = '\v\!\<'.s:ns_uri_char.'+\>' let s:c_ns_tag_property = '\v'.s:c_verbatim_tag. \ '\v|'.s:c_ns_shorthand_tag. diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 63d25db529..9f84e6dfb6 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -2,7 +2,7 @@ " " Author: Bram Moolenaar " Copyright: Vim license applies, see ":help license" -" Last Change: 2022 Apr 16 +" Last Change: 2022 May 04 " " WORK IN PROGRESS - The basics works stable, more to come " Note: In general you need at least GDB 7.12 because this provides the @@ -915,7 +915,7 @@ func s:DeleteCommands() if empty(s:k_map_saved) nunmap K else - call mapset('n', 0, s:k_map_saved) + call mapset(s:k_map_saved) endif unlet s:k_map_saved endif diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim index 2516967807..f5a50bfacd 100644 --- a/runtime/syntax/help.vim +++ b/runtime/syntax/help.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Vim help file " Maintainer: Bram Moolenaar (Bram@vim.org) -" Last Change: 2021 Jun 13 +" Last Change: 2022 May 01 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -215,6 +215,12 @@ hi def link helpError Error hi def link helpTodo Todo hi def link helpURL String +if expand('%:p') == $VIMRUNTIME .. '/doc/syntax.txt' + " highlight groups with their respective color + import 'dist/vimhelp.vim' + call vimhelp.HighlightGroups() +endif + let b:current_syntax = "help" let &cpo = s:cpo_save diff --git a/runtime/syntax/i3config.vim b/runtime/syntax/i3config.vim index a2f50e50b8..6163da29eb 100644 --- a/runtime/syntax/i3config.vim +++ b/runtime/syntax/i3config.vim @@ -3,7 +3,7 @@ " Original Author: Mohamed Boughaba <mohamed dot bgb at gmail dot com> " Maintainer: Quentin Hibon (github user hiqua) " Version: 0.4 -" Last Change: 2022 Jan 15 +" Last Change: 2022 May 05 " References: " http://i3wm.org/docs/userguide.html#configuring @@ -50,6 +50,10 @@ syn match i3ConfigVariable /\$\w\+\(\(-\w\+\)\+\)\?\(\s\|+\)\?/ contains=i3Confi syn keyword i3ConfigInitializeKeyword set contained syn match i3ConfigInitialize /^\s*set\s\+.*$/ contains=i3ConfigVariable,i3ConfigInitializeKeyword,i3ConfigColor,i3ConfigString +" Include +syn keyword i3ConfigIncludeKeyword include contained +syn match i3ConfigInclude /^\s*include\s\+.*$/ contains=i3ConfigIncludeKeyword,i3ConfigString,i3ConfigVariable + " Gaps syn keyword i3ConfigGapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle up down contained syn match i3ConfigGapStyle /^\s*\(gaps\)\s\+\(inner\|outer\|horizontal\|vertical\|left\|top\|right\|bottom\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\|toggle\)\)\?\(\s\+\(-\?\d\+\|\$.*\)\)$/ contains=i3ConfigGapStyleKeyword,i3ConfigNumber,i3ConfigVariable @@ -221,6 +225,7 @@ hi def link i3ConfigAssignSpecial Special hi def link i3ConfigFontNamespace PreProc hi def link i3ConfigBindArgument PreProc hi def link i3ConfigNoStartupId PreProc +hi def link i3ConfigIncludeKeyword Identifier hi def link i3ConfigFontKeyword Identifier hi def link i3ConfigBindKeyword Identifier hi def link i3ConfigOrientation Identifier diff --git a/runtime/syntax/plsql.vim b/runtime/syntax/plsql.vim index 0ac53d03f9..7b36c0a180 100644 --- a/runtime/syntax/plsql.vim +++ b/runtime/syntax/plsql.vim @@ -4,7 +4,7 @@ " Previous Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com) " Previous Maintainer: C. Laurence Gonsalves (clgonsal@kami.com) " URL: https://github.com/lee-lindley/vim_plsql_syntax -" Last Change: April 25, 2022 +" Last Change: April 28, 2022 " History Lee Lindley (lee dot lindley at gmail dot com) " updated to 19c keywords. refined quoting. " separated reserved, non-reserved keywords and functions @@ -23,9 +23,6 @@ " To enable folding (It does setlocal foldmethod=syntax) " let plsql_fold = 1 " -" If you want to try procedure folding, it has issues -" let plsql_procedure_fold = 1 -" " From my vimrc file -- turn syntax and syntax folding on, " associate file suffixes as plsql, open all the folds on file open " let plsql_fold = 1 @@ -67,23 +64,23 @@ syn match plsqlSymbol "[;,.()]" " Operators. and words that would be something else if not in operator mode syn match plsqlOperator "[-+*/=<>@"]" -syn match plsqlOperator "\%\(\^=\|<=\|>=\|:=\|=>\|\.\.\|||\|<<\|>>\|\*\*\|!=\|\~=\)" -syn match plsqlOperator "\<\%\(NOT\|AND\|OR\|LIKE\|BETWEEN\|IN\)\>" +syn match plsqlOperator "\(\^=\|<=\|>=\|:=\|=>\|\.\.\|||\|<<\|>>\|\*\*\|!=\|\~=\)" +syn match plsqlOperator "\<\(NOT\|AND\|OR\|LIKE\|BETWEEN\|IN\)\>" syn match plsqlBooleanLiteral "\<NULL\>" -syn match plsqlOperator "\<IS\\_s\+\%\(NOT\_s\+\)\?NULL\>" +syn match plsqlOperator "\<IS\\_s\+\(NOT\_s\+\)\?NULL\>" " " conditional compilation Preprocessor directives and sqlplus define sigil syn match plsqlPseudo "$[$a-z][a-z0-9$_#]*" syn match plsqlPseudo "&" -syn match plsqlReserved "\<\%\(CREATE\|THEN\|UPDATE\|INSERT\|SET\)\>" -syn match plsqlKeyword "\<\%\(REPLACE\|PACKAGE\|FUNCTION\|PROCEDURE\|TYPE|BODY\|WHEN\|MATCHED\)\>" +syn match plsqlReserved "\<\(CREATE\|THEN\|UPDATE\|INSERT\|SET\)\>" +syn match plsqlKeyword "\<\(REPLACE\|PACKAGE\|FUNCTION\|PROCEDURE\|TYPE|BODY\|WHEN\|MATCHED\)\>" syn region plsqlUpdate \ matchgroup=plsqlReserved \ start="\<UPDATE\>" \ end="\<SET\>" \ contains=@plsqlIdentifiers -syn match plsqlReserved "\<WHEN\_s\+\%\(NOT\_s\+\)\?MATCHED\_s\+THEN\_s\+\%\(UPDATE\|INSERT\)\%\(\_s\+SET\)\?" +syn match plsqlReserved "\<WHEN\_s\+\(NOT\_s\+\)\?MATCHED\_s\+THEN\_s\+\(UPDATE\|INSERT\)\(\_s\+SET\)\?" " " Oracle's non-reserved keywords @@ -463,7 +460,9 @@ syn keyword plsqlReserved OCIDURATION OCIINTERVAL OCILOBLOCATOR OCINUMBER OCIRAW syn keyword plsqlReserved OCIROWID OCISTRING OCITYPE OF ON OPTION ORACLE ORADATA ORDER ORLANY ORLVARY syn keyword plsqlReserved OUT OVERRIDING PARALLEL_ENABLE PARAMETER PASCAL PCTFREE PIPE PIPELINED POLYMORPHIC syn keyword plsqlReserved PRAGMA PRIOR PUBLIC RAISE RECORD RELIES_ON REM RENAME RESOURCE RESULT REVOKE ROWID -syn keyword plsqlReserved SB1 SB2 SELECT SEPARATE SHARE SHORT SIZE SIZE_T SPARSE SQLCODE SQLDATA +syn keyword plsqlReserved SB1 SB2 +syn match plsqlReserved "\<SELECT\>" +syn keyword plsqlReserved SEPARATE SHARE SHORT SIZE SIZE_T SPARSE SQLCODE SQLDATA syn keyword plsqlReserved SQLNAME SQLSTATE STANDARD START STORED STRUCT STYLE SYNONYM TABLE TDO syn keyword plsqlReserved TRANSACTIONAL TRIGGER UB1 UB4 UNION UNIQUE UNSIGNED UNTRUSTED VALIST syn keyword plsqlReserved VALUES VARIABLE VIEW VOID WHERE WITH @@ -517,28 +516,30 @@ syn match plsqlFunction "\.PREV\>"hs=s+1 syn match plsqlFunction "\.NEXT\>"hs=s+1 if exists("plsql_legacy_sql_keywords") -" Some of Oracle's SQL keywords. -syn keyword plsqlSQLKeyword ABORT ACCESS ACCESSED ADD AFTER ALL ALTER AND ANY -syn keyword plsqlSQLKeyword ASC ATTRIBUTE AUDIT AUTHORIZATION AVG BASE_TABLE -syn keyword plsqlSQLKeyword BEFORE BETWEEN BY CASCADE CAST CHECK CLUSTER -syn keyword plsqlSQLKeyword CLUSTERS COLAUTH COLUMN COMMENT COMPRESS CONNECT -syn keyword plsqlSQLKeyword CONSTRAINT CRASH CURRENT DATA DATABASE -syn keyword plsqlSQLKeyword DATA_BASE DBA DEFAULT DELAY DELETE DESC DISTINCT -syn keyword plsqlSQLKeyword DROP DUAL EXCLUSIVE EXISTS EXTENDS EXTRACT -syn keyword plsqlSQLKeyword FILE FORCE FOREIGN FROM GRANT GROUP HAVING HEAP -syn keyword plsqlSQLKeyword IDENTIFIED IDENTIFIER IMMEDIATE IN INCLUDING -syn keyword plsqlSQLKeyword INCREMENT INDEX INDEXES INITIAL INSERT INSTEAD -syn keyword plsqlSQLKeyword INTERSECT INTO INVALIDATE ISOLATION KEY LIBRARY -syn keyword plsqlSQLKeyword LIKE LOCK MAXEXTENTS MINUS MODE MODIFY MULTISET -syn keyword plsqlSQLKeyword NESTED NOAUDIT NOCOMPRESS NOT NOWAIT OF OFF OFFLINE -syn keyword plsqlSQLKeyword ON ONLINE OPERATOR OPTION ORDER ORGANIZATION -syn keyword plsqlSQLKeyword PCTFREE PRIMARY PRIOR PRIVATE PRIVILEGES PUBLIC -syn keyword plsqlSQLKeyword QUOTA RELEASE RENAME REPLACE RESOURCE REVOKE ROLLBACK -syn keyword plsqlSQLKeyword ROW ROWLABEL ROWS SCHEMA SELECT SEPARATE SESSION SET -syn keyword plsqlSQLKeyword SHARE SIZE SPACE START STORE SUCCESSFUL SYNONYM -syn keyword plsqlSQLKeyword SYSDATE TABLE TABLES TABLESPACE TEMPORARY TO TREAT -syn keyword plsqlSQLKeyword TRIGGER TRUNCATE UID UNION UNIQUE UNLIMITED UPDATE -syn keyword plsqlSQLKeyword USE USER VALIDATE VALUES VIEW WHENEVER WHERE WITH + " Some of Oracle's SQL keywords. + syn keyword plsqlSQLKeyword ABORT ACCESS ACCESSED ADD AFTER ALL ALTER AND ANY + syn keyword plsqlSQLKeyword ASC ATTRIBUTE AUDIT AUTHORIZATION AVG BASE_TABLE + syn keyword plsqlSQLKeyword BEFORE BETWEEN BY CASCADE CAST CHECK CLUSTER + syn keyword plsqlSQLKeyword CLUSTERS COLAUTH COLUMN COMMENT COMPRESS CONNECT + syn keyword plsqlSQLKeyword CONSTRAINT CRASH CURRENT DATA DATABASE + syn keyword plsqlSQLKeyword DATA_BASE DBA DEFAULT DELAY DELETE DESC DISTINCT + syn keyword plsqlSQLKeyword DROP DUAL EXCLUSIVE EXISTS EXTENDS EXTRACT + syn keyword plsqlSQLKeyword FILE FORCE FOREIGN FROM GRANT GROUP HAVING HEAP + syn keyword plsqlSQLKeyword IDENTIFIED IDENTIFIER IMMEDIATE IN INCLUDING + syn keyword plsqlSQLKeyword INCREMENT INDEX INDEXES INITIAL INSERT INSTEAD + syn keyword plsqlSQLKeyword INTERSECT INTO INVALIDATE ISOLATION KEY LIBRARY + syn keyword plsqlSQLKeyword LIKE LOCK MAXEXTENTS MINUS MODE MODIFY MULTISET + syn keyword plsqlSQLKeyword NESTED NOAUDIT NOCOMPRESS NOT NOWAIT OF OFF OFFLINE + syn keyword plsqlSQLKeyword ON ONLINE OPERATOR OPTION ORDER ORGANIZATION + syn keyword plsqlSQLKeyword PCTFREE PRIMARY PRIOR PRIVATE PRIVILEGES PUBLIC + syn keyword plsqlSQLKeyword QUOTA RELEASE RENAME REPLACE RESOURCE REVOKE ROLLBACK + syn keyword plsqlSQLKeyword ROW ROWLABEL ROWS SCHEMA + syn match plsqlSQLKeyword "\<SELECT\>" + syn keyword plsqlSQLKeyword SEPARATE SESSION SET + |