diff --git a/runtime/compiler/eslint.vim b/runtime/compiler/eslint.vim new file mode 100644 index 0000000000..1e7af2b182 --- /dev/null +++ b/runtime/compiler/eslint.vim @@ -0,0 +1,16 @@ +" Vim compiler file +" Compiler: ESLint for JavaScript +" Maintainer: Romain Lafourcade +" Last Change: 2020 May 17 + +if exists("current_compiler") + finish +endif +let current_compiler = "eslint" + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet makeprg=eslint\ --format\ compact +CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m,%-G%.%# diff --git a/runtime/compiler/standard.vim b/runtime/compiler/standard.vim new file mode 100644 index 0000000000..b6bcf1f6b0 --- /dev/null +++ b/runtime/compiler/standard.vim @@ -0,0 +1,16 @@ +" Vim compiler file +" Compiler: Standard for JavaScript +" Maintainer: Romain Lafourcade +" Last Change: 2020 May 17 + +if exists("current_compiler") + finish +endif +let current_compiler = "standard" + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet makeprg=standard +CompilerSet errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m,%-G%.%# diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 5470aab2b7..edc37a66cf 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -538,6 +538,8 @@ adict. Weeding out entries from a Dictionary can be done with |filter()|: > :call filter(dict, 'v:val =~ "x"') This removes all entries from "dict" with a value not matching 'x'. +This can also be used to remove all entries: > + call filter(dict, 0) Dictionary function ~ @@ -2521,6 +2523,7 @@ win_splitmove({nr}, {target} [, {options}]) Number move window {nr} to split of {target} winbufnr({nr}) Number buffer number of window {nr} wincol() Number window column of the cursor +windowsversion() String MS-Windows OS version winheight({nr}) Number height of window {nr} winlayout([{tabnr}]) List layout of windows in tab {tabnr} winline() Number window line of the cursor diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 47a39926d4..503e3a87bf 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -819,7 +819,7 @@ tag char note action in Normal mode ~ |zD| zD delete folds recursively |zE| zE eliminate all folds |zF| zF create a fold for N lines -|zG| zG mark word as good spelled word +|zG| zG temporarily mark word as good spelled word |zH| zH when 'wrap' off scroll half a screenwidth to the right |zL| zL when 'wrap' off scroll half a screenwidth @@ -828,7 +828,7 @@ tag char note action in Normal mode ~ |zN| zN set 'foldenable' |zO| zO open folds recursively |zR| zR set 'foldlevel' to the deepest fold -|zW| zW mark word as wrong (bad) spelled word +|zW| zW temporarily mark word as bad spelled word |zX| zX re-apply 'foldlevel' |z^| z^ cursor on line N (default line above window), otherwise like "z-" @@ -840,7 +840,7 @@ tag char note action in Normal mode ~ position the cursor at the end (right side) of the screen |zf| zf{motion} create a fold for Nmove text -|zg| zg mark word as good spelled word +|zg| zg permanently mark word as good spelled word |zh| zh when 'wrap' off scroll screen N characters to the right |zi| zi toggle 'foldenable' @@ -861,7 +861,7 @@ tag char note action in Normal mode ~ |zuW| zuW undo |zW| |zuG| zuG undo |zG| |zv| zv open enough folds to view the cursor line -|zw| zw mark word as wrong (bad) spelled word +|zw| zw permanently mark word as bad spelled word |zx| zx re-apply 'foldlevel' and do "zv" |zz| zz redraw, cursor line at center of window |z| z same as "zh" diff --git a/runtime/doc/makehtml.awk b/runtime/doc/makehtml.awk index 6e93c01c54..50f5611fa7 100644 --- a/runtime/doc/makehtml.awk +++ b/runtime/doc/makehtml.awk @@ -65,7 +65,7 @@ substr($0,length($0),1) == "~" { print "" substr($0,1, # #ad hoc code # -/^"\|\& / {gsub(/\|/,"\\|"); } +/^"\|& / {gsub(/\|/,"\\|"); } / = b / {gsub(/ b /," \\b "); } # # one letter tag diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index d38691a59e..31bd93ca24 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -117,6 +117,11 @@ q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"} recorded macro and the yank will overwrite the recorded macro. + Note: The recording happens while you type, replaying + the register happens as if the keys come from a + mapping. This matters, for example, for undo, which + only syncs when commands were typed. + q Stops recording. Implementation note: The 'q' that stops recording is not stored in the register, unless it was the result @@ -129,7 +134,7 @@ q Stops recording. used. The register is executed like a mapping, that means that the difference between 'wildchar' and 'wildcharm' - applies. + applies, and undo might not be synced in the same way. For "@=" you are prompted to enter an expression. The result of the expression is then executed. See also |@:|. diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 34f5eb6db1..c0d0fc00cd 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -12,7 +12,7 @@ endif let b:did_ftplugin = 1 let s:cpo_save = &cpo -set cpo-=C +set cpo&vim if !exists('*VimFtpluginUndo') func VimFtpluginUndo() @@ -66,14 +66,14 @@ if !exists("no_plugin_maps") && !exists("no_vim_maps") let b:did_add_maps = 1 " Move around functions. - nnoremap [[ m':call search('^\s*fu\%[nction]\>', "bW") - vnoremap [[ m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "bW") - nnoremap ]] m':call search('^\s*fu\%[nction]\>', "W") - vnoremap ]] m':exe "normal! gv"call search('^\s*fu\%[nction]\>', "W") - nnoremap [] m':call search('^\s*endf\%[unction]\>', "bW") - vnoremap [] m':exe "normal! gv"call search('^\s*endf\%[unction]\>', "bW") - nnoremap ][ m':call search('^\s*endf\%[unction]\>', "W") - vnoremap ][ m':exe "normal! gv"call search('^\s*endf\%[unction]\>', "W") + nnoremap [[ m':call search('^\s*\(fu\%[nction]\\|def\)\>', "bW") + vnoremap [[ m':exe "normal! gv"call search('^\s*\(fu\%[nction]\\|def\)\>', "bW") + nnoremap ]] m':call search('^\s*\(fu\%[nction]\\|def\)\>', "W") + vnoremap ]] m':exe "normal! gv"call search('^\s*\(fu\%[nction]\\|def\)\>', "W") + nnoremap [] m':call search('^\s*end\(f\%[unction]\\|def\)\>', "bW") + vnoremap [] m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|def\)\>', "bW") + nnoremap ][ m':call search('^\s*end\(f\%[unction]\\|def\)\>', "W") + vnoremap ][ m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|def\)\>', "W") " Move around comments nnoremap ]" :call search('^\(\s*".*\n\)\@ diff --git a/runtime/indent/sshconfig.vim b/runtime/indent/sshconfig.vim new file mode 100644 index 0000000000..b456a9e3aa --- /dev/null +++ b/runtime/indent/sshconfig.vim @@ -0,0 +1,34 @@ +" Vim indent file +" Language: ssh config file +" Maintainer: JasonKim +" Last Change: 2020 May 16 + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal autoindent +setlocal indentexpr=GetSshconfigIndent(v:lnum) +setlocal indentkeys=o,O,*,0=~host\ ,0=~match\ ,0#,!^F + +let b:undo_indent = "setlocal autoindent< indentexpr< indentkeys<" + +if exists("*GetSshconfigIndent") + finish +endif + +function GetSshconfigIndent(lnum) + let sw = shiftwidth() + let prev_lnum = prevnonblank(a:lnum - 1) + let curr_lnum = a:lnum + let prev_line = getline(prev_lnum) + let curr_line = getline(curr_lnum) + if curr_line =~? '^\s*\(host\|match\)\s' + return 0 + elseif prev_line =~? '^\s*\(host\|match\)\s' + return sw + else + return indent(prev_lnum) + endif +endfunction diff --git a/runtime/indent/testdir/sshconfig.in b/runtime/indent/testdir/sshconfig.in new file mode 100644 index 0000000000..87b998e465 --- /dev/null +++ b/runtime/indent/testdir/sshconfig.in @@ -0,0 +1,53 @@ +# vim: set filetype=sshconfig shiftwidth=4 expandtab : + +# START_INDENT +Host myhost +User myuser +PasswordAuthentication no +# END_INDENT + +# START_INDENT +Host aaa +User bbb +Host ccc +Host ddd +# END_INDENT + +# START_INDENT +host aaa +HOST bbb +hoSt ccc +match ddd +MATCH eee +MatCH fff +# END_INDENT + +# START_INDENT +Host aaa +User host +PasswordAuthentication no +Host * +User user +PasswordAuthentication no +Host match +User bbb +# END_INDENT + +# START_INDENT +Host tab +User myuser +# END_INDENT + +# START_INDENT +Host mix +User myuser +# END_INDENT + +# START_INDENT +Host aaa +User bbb +Match ccc +User ddd +HostKeyAlgorithms ssh-ed25519 +Match eee +# END_INDENT diff --git a/runtime/indent/testdir/sshconfig.ok b/runtime/indent/testdir/sshconfig.ok new file mode 100644 index 0000000000..b24b7cf4e1 --- /dev/null +++ b/runtime/indent/testdir/sshconfig.ok @@ -0,0 +1,53 @@ +# vim: set filetype=sshconfig shiftwidth=4 expandtab : + +# START_INDENT +Host myhost + User myuser + PasswordAuthentication no +# END_INDENT + +# START_INDENT +Host aaa + User bbb +Host ccc +Host ddd +# END_INDENT + +# START_INDENT +host aaa +HOST bbb +hoSt ccc +match ddd +MATCH eee +MatCH fff +# END_INDENT + +# START_INDENT +Host aaa + User host + PasswordAuthentication no +Host * + User user + PasswordAuthentication no +Host match + User bbb +# END_INDENT + +# START_INDENT +Host tab + User myuser +# END_INDENT + +# START_INDENT +Host mix + User myuser +# END_INDENT + +# START_INDENT +Host aaa + User bbb +Match ccc + User ddd + HostKeyAlgorithms ssh-ed25519 +Match eee +# END_INDENT diff --git a/runtime/macros/less.vim b/runtime/macros/less.vim index aad122d70a..4883dae41a 100644 --- a/runtime/macros/less.vim +++ b/runtime/macros/less.vim @@ -1,6 +1,6 @@ " Vim script to work like "less" " Maintainer: Bram Moolenaar -" Last Change: 2017 Mar 31 +" Last Change: 2020 May 18 " Avoid loading this file twice, allow the user to define his own script. if exists("loaded_less") @@ -66,8 +66,8 @@ endif " When reading from stdin don't consider the file modified. au VimEnter * set nomod -" Can't modify the text -set noma +" Can't modify the text or write the file. +set nomodifiable readonly " Give help noremap h :call Help() diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 99819c93ea..41d59c39d9 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: 2020 Feb 19 +" Last Change: 2020 May 22 " " WORK IN PROGRESS - Only the basics work " Note: On MS-Windows you need a recent version of gdb. The one included with @@ -758,8 +758,10 @@ func s:InstallCommands() command Asm call s:GotoAsmwinOrCreateIt() command Winbar call s:InstallWinbar() - " TODO: can the K mapping be restored? - nnoremap K :Evaluate + if !exists('g:termdebug_map_K') || g:termdebug_map_K + let s:k_map_saved = maparg('K', 'n', 0, 1) + nnoremap K :Evaluate + endif let &cpo = save_cpo endfunc @@ -797,7 +799,10 @@ func s:DeleteCommands() delcommand Asm delcommand Winbar - nunmap K + if exists('s:k_map_saved') + call mapset('n', 0, s:k_map_saved) + unlet s:k_map_saved + endif exe 'sign unplace ' . s:pc_id for [id, entries] in items(s:breakpoints) diff --git a/runtime/syntax/groovy.vim b/runtime/syntax/groovy.vim index 2245b79d04..9bc1bd6d8d 100644 --- a/runtime/syntax/groovy.vim +++ b/runtime/syntax/groovy.vim @@ -1,10 +1,10 @@ " Vim syntax file " Language: Groovy -" Original Author: Alessio Pace -" Maintainer: Tobias Rapp -" Version: 0.1.16 +" Original Author: Alessio Pace +" Maintainer: Tobias Rapp +" Version: 0.1.17 " URL: http://www.vim.org/scripts/script.php?script_id=945 -" Last Change: 2016 May 23 +" Last Change: 2020 May 26 " THE ORIGINAL AUTHOR'S NOTES: " @@ -253,7 +253,7 @@ if exists("groovy_regex_strings") endif " syn region groovyELExpr start=+${+ end=+}+ keepend contained syn match groovyELExpr /\${.\{-}}/ contained -syn match groovyELExpr /\$[a-zA-Z_][a-zA-Z0-9_.]*/ contained +syn match groovyELExpr /\$[a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE_][a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\uFFFE0-9_.]*/ contained hi def link groovyELExpr Identifier " TODO: better matching. I am waiting to understand how it really works in groovy diff --git a/runtime/syntax/spec.vim b/runtime/syntax/spec.vim index 4df549e677..d7d5877943 100644 --- a/runtime/syntax/spec.vim +++ b/runtime/syntax/spec.vim @@ -3,7 +3,7 @@ " Language: SPEC: Build/install scripts for Linux RPM packages " Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com " Former Maintainer: Donovan Rebbechi elflord@panix.com (until March 2014) -" Last Change: 2020 Feb 07 +" Last Change: 2020 May 25 " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -128,6 +128,8 @@ syn case match "sh-like comment stile, only valid in script part syn match shComment contained '#.*$' +syn region dnlComment matchgroup=specComment start=+%dnl+ end=+$+ + syn region shQuote1 contained matchgroup=shQuoteDelim start=+'+ skip=+\\'+ end=+'+ contains=specMacroIdentifier syn region shQuote2 contained matchgroup=shQuoteDelim start=+"+ skip=+\\"+ end=+"+ contains=specVariables,specMacroIdentifier @@ -173,6 +175,7 @@ endif "sh colors hi def link shComment Comment +hi def link dnlComment Comment hi def link shIf Statement hi def link shOperator Special hi def link shQuote1 String diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index dcca7297ec..dfcd931abd 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -201,7 +201,7 @@ syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperPa syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "||\|&&\|[-+.!]" skipwhite nextgroup=vimString,vimSpecFile -syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup +syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=vimoperStar,@vimOperGroup syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror") syn match vimOperError ")" @@ -272,7 +272,7 @@ syn match vimComment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCom syn match vimComment +\!\\@]"+lc=1 skip=+\\\\\|\\" syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+ syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup syn region vimString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=@vimStringGroup -syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup +"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ @@ -911,6 +911,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimNumber Number hi def link vimOperError Error hi def link vimOper Operator + hi def link vimOperStar vimOper hi def link vimOption PreProc hi def link vimParenSep Delimiter hi def link vimPatSepErr vimError