From 144279ef30a432ac8416746e3491f3120ae9b4e8 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 3 Feb 2023 09:18:18 +0100 Subject: vim-patch:be4e01637e71 (#22103) Update runtime files. https://github.com/vim/vim/commit/be4e01637e71c8d5095c33b9861fd70b41476732 Co-authored-by: Bram Moolenaar --- runtime/ftplugin/debchangelog.vim | 10 +++++----- runtime/ftplugin/debcontrol.vim | 4 ++-- runtime/ftplugin/logcheck.vim | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim index cf8dd17c44..062fc054c8 100644 --- a/runtime/ftplugin/debchangelog.vim +++ b/runtime/ftplugin/debchangelog.vim @@ -3,9 +3,9 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Michael Piefel " Stefano Zacchiroli -" Last Change: 2022 Jul 25 +" Last Change: 2023 Jan 16 " License: Vim License -" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debchangelog.vim +" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/debchangelog.vim " Bug completion requires apt-listbugs installed for Debian packages or " python-launchpadlib installed for Ubuntu packages @@ -35,14 +35,14 @@ if exists('g:did_changelog_ftplugin') finish endif +" Don't load another plugin (this is global) +let g:did_changelog_ftplugin = 1 + " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise " would not be recognized. See ":help 'cpoptions'". let s:cpo_save = &cpo set cpo&vim -" Don't load another plugin (this is global) -let g:did_changelog_ftplugin = 1 - " {{{1 GUI menu " Helper functions returning various data. diff --git a/runtime/ftplugin/debcontrol.vim b/runtime/ftplugin/debcontrol.vim index 3a6e39a682..bb710e597c 100644 --- a/runtime/ftplugin/debcontrol.vim +++ b/runtime/ftplugin/debcontrol.vim @@ -2,8 +2,8 @@ " Language: Debian control files " Maintainer: Debian Vim Maintainers " Former Maintainer: Pierre Habouzit -" Last Change: 2018-01-28 -" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debcontrol.vim +" Last Change: 2023 Jan 16 +" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/debcontrol.vim " Do these settings once per buffer if exists('b:did_ftplugin') diff --git a/runtime/ftplugin/logcheck.vim b/runtime/ftplugin/logcheck.vim index 9d664b2d09..9c1be1108e 100644 --- a/runtime/ftplugin/logcheck.vim +++ b/runtime/ftplugin/logcheck.vim @@ -1,9 +1,9 @@ " Vim filetype plugin file " Language: Logcheck " Maintainer: Debian Vim Maintainers -" Last Change: 2018 Dec 27 +" Last Change: 2023 Jan 16 " License: Vim License -" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/logcheck.vim +" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/logcheck.vim if exists('b:did_ftplugin') finish -- cgit From 2e450efb9525308708dd9e26d6ea1d029ac781b8 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 15 Feb 2023 09:55:23 +0100 Subject: feat(treesitter)!: remove g:ts_highlight_lua (#22257) This variable was only meant for easy testing during the development cycle for treesitter highlighting while Lua was the only parser useable for daily driving. Now that we have a good vimdoc parser, this approach simply doesn't scale and should be removed sooner rather than later. Instead of setting this variable, people for now should add the autocommand directly to their config: ```lua vim.api.nvim_create_autocmd('FileType', { pattern = 'lua', -- or { 'lua', 'help' } callback = function() vim.treesitter.start() end, }) ``` (or put `vim.treesitter.start()` in an `ftplugin`). --- runtime/ftplugin/lua.lua | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 runtime/ftplugin/lua.lua (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/lua.lua b/runtime/ftplugin/lua.lua deleted file mode 100644 index 415cf28f9a..0000000000 --- a/runtime/ftplugin/lua.lua +++ /dev/null @@ -1,3 +0,0 @@ -if vim.g.ts_highlight_lua then - vim.treesitter.start() -end -- cgit From ee26b227e15abc263195d4c746d5dba9f0e6dec4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 21 Feb 2023 23:50:29 +0800 Subject: vim-patch:partial:938ae280c79b (#22356) Update runtime files. https://github.com/vim/vim/commit/938ae280c79b8cdb0fca60336ec4c090ecd8bb5a Partially skip autocmd.txt: needs patch 8.2.5011. Partially skip builtin.txt: needs patch 9.0.0411. Partially skip eval.txt: needs patch 8.2.3783. Cherry-pick :map-meta-keys from patch 9.0.1276. Co-authored-by: Bram Moolenaar --- runtime/ftplugin/dosbatch.vim | 18 +++++++++++++----- runtime/ftplugin/fish.vim | 15 +++++++++++++++ runtime/ftplugin/vim.vim | 23 ++++++++++++++--------- 3 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 runtime/ftplugin/fish.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/dosbatch.vim b/runtime/ftplugin/dosbatch.vim index 0c5cde2503..f02f26b1fd 100644 --- a/runtime/ftplugin/dosbatch.vim +++ b/runtime/ftplugin/dosbatch.vim @@ -1,7 +1,10 @@ " Vim filetype plugin file -" Language: MS-DOS .bat files -" Maintainer: Mike Williams -" Last Change: 7th May 2020 +" Language: MS-DOS/Windows .bat files +" Maintainer: Mike Williams +" Last Change: 12th February 2023 +" +" Options Flags: +" dosbatch_colons_comment - any value to treat :: as comment line " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -15,8 +18,13 @@ let s:cpo_save = &cpo set cpo&vim " BAT comment formatting -setlocal comments=b:rem,b:@rem,b:REM,b:@REM,::: -setlocal commentstring=::\ %s +setlocal comments=b:rem,b:@rem,b:REM,b:@REM +if exists("dosbatch_colons_comment") + setlocal comments+=::: + setlocal commentstring=::\ %s +else + setlocal commentstring=REM\ %s +endif setlocal formatoptions-=t formatoptions+=rol " Lookup DOS keywords using Windows command help. diff --git a/runtime/ftplugin/fish.vim b/runtime/ftplugin/fish.vim new file mode 100644 index 0000000000..7acbf44210 --- /dev/null +++ b/runtime/ftplugin/fish.vim @@ -0,0 +1,15 @@ +" Vim filetype plugin file +" Language: fish +" Maintainer: Nicholas Boyle (github.com/nickeb96) +" Repository: https://github.com/nickeb96/fish.vim +" Last Change: February 1, 2023 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal iskeyword=@,48-57,_,192-255,-,. +setlocal comments=:# +setlocal commentstring=#%s +setlocal formatoptions+=crjq diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index b64bb55d68..a2cbc28971 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Vim " Maintainer: Bram Moolenaar -" Last Change: 2022 Nov 27 +" Last Change: 2023 Feb 07 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -98,18 +98,23 @@ if exists("loaded_matchit") " func name " require a parenthesis following, then there can be an "endfunc". let b:match_words = - \ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' . - \ '\<\(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' . - \ '\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' . - \ '{:},' . - \ '\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' . - \ '\\)\@!\S:\,' + \ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' .. + \ '\<\%(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' .. + \ '\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' .. + \ '{:},' .. + \ '\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\:\%(\%(^\||\)\s*\)\@<=\,' .. + \ '\\)\@!\S:\,' .. + \ '\:\,' .. + \ '\:\,' .. + \ '\:\,' + " Ignore syntax region commands and settings, any 'en*' would clobber " if-endif. " - set spl=de,en " - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ … - let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") - \ =~? "comment\\|string\\|vimLetHereDoc\\|vimSynReg\\|vimSet"' + " Also ignore here-doc and dictionary keys (vimVar). + let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name") + \ =~? "comment\\|string\\|vimSynReg\\|vimSet\\|vimLetHereDoc\\|vimVar"' endif let &cpo = s:cpo_save -- cgit From 66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 28 Feb 2023 09:34:27 +0100 Subject: vim-patch:partial:dd60c365cd26 (#22437) vim-patch:partial:dd60c365cd26 Update runtime files https://github.com/vim/vim/commit/dd60c365cd2630794be84d63c4fe287124a30b97 Co-authored-by: Bram Moolenaar Skip: eval.txt, repeat.txt (needs `getscriptinfo()`) --- runtime/ftplugin/quarto.vim | 1 + runtime/ftplugin/r.vim | 4 ++-- runtime/ftplugin/rhelp.vim | 4 ++-- runtime/ftplugin/rmd.vim | 21 ++++++++++++++++----- runtime/ftplugin/rnoweb.vim | 21 +++++++++++++++++++-- runtime/ftplugin/rrst.vim | 4 ++-- 6 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 runtime/ftplugin/quarto.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/quarto.vim b/runtime/ftplugin/quarto.vim new file mode 100644 index 0000000000..a76bcc2c7e --- /dev/null +++ b/runtime/ftplugin/quarto.vim @@ -0,0 +1 @@ +runtime ftplugin/rmd.vim diff --git a/runtime/ftplugin/r.vim b/runtime/ftplugin/r.vim index a78afa2e7e..28966368cb 100644 --- a/runtime/ftplugin/r.vim +++ b/runtime/ftplugin/r.vim @@ -2,7 +2,7 @@ " Language: R " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Aug 15, 2020 11:37AM +" Last Change: Sun Apr 24, 2022 09:14AM " Only do this when not yet done for this buffer if exists("b:did_ftplugin") @@ -22,7 +22,7 @@ setlocal comments=:#',:###,:##,:# if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "R Source Files (*.R)\t*.R\n" . - \ "Files that include R (*.Rnw *.Rd *.Rmd *.Rrst)\t*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . + \ "Files that include R (*.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" . \ "All Files (*.*)\t*.*\n" endif diff --git a/runtime/ftplugin/rhelp.vim b/runtime/ftplugin/rhelp.vim index d0b546d62d..2fde4875c6 100644 --- a/runtime/ftplugin/rhelp.vim +++ b/runtime/ftplugin/rhelp.vim @@ -2,7 +2,7 @@ " Language: R help file " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Aug 15, 2020 12:01PM +" Last Change: Sun Apr 24, 2022 09:12AM " Only do this when not yet done for this buffer if exists("b:did_ftplugin") @@ -18,7 +18,7 @@ set cpo&vim setlocal iskeyword=@,48-57,_,. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . + let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" . \ "All Files (*.*)\t*.*\n" endif diff --git a/runtime/ftplugin/rmd.vim b/runtime/ftplugin/rmd.vim index 2ee72ffc6c..355b88f04a 100644 --- a/runtime/ftplugin/rmd.vim +++ b/runtime/ftplugin/rmd.vim @@ -2,7 +2,7 @@ " Language: R Markdown file " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Aug 15, 2020 12:03PM +" Last Change: Sun Apr 24, 2022 09:12AM " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann) " Only do this when not yet done for this buffer @@ -32,13 +32,24 @@ function! FormatRmd() return 1 endfunction -" If you do not want 'comments' dynamically defined, put in your vimrc: -" let g:rmd_dynamic_comments = 0 +function! SetRmdCommentStr() + if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW')) + set commentstring=#\ %s + else + set commentstring= + endif +endfunction + +" If you do not want both 'comments' and 'commentstring' dynamically defined, +" put in your vimrc: let g:rmd_dynamic_comments = 0 if !exists("g:rmd_dynamic_comments") || (exists("g:rmd_dynamic_comments") && g:rmd_dynamic_comments == 1) setlocal formatexpr=FormatRmd() + augroup RmdCStr + autocmd! + autocmd CursorMoved call SetRmdCommentStr() + augroup END endif - " Enables pandoc if it is installed unlet! b:did_ftplugin runtime ftplugin/pandoc.vim @@ -47,7 +58,7 @@ runtime ftplugin/pandoc.vim let b:did_ftplugin = 1 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . + let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" . \ "All Files (*.*)\t*.*\n" endif diff --git a/runtime/ftplugin/rnoweb.vim b/runtime/ftplugin/rnoweb.vim index dc5f1b5e06..cf1c0922c0 100644 --- a/runtime/ftplugin/rnoweb.vim +++ b/runtime/ftplugin/rnoweb.vim @@ -2,7 +2,7 @@ " Language: Rnoweb " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Aug 15, 2020 12:02PM +" Last Change: Sun Apr 24, 2022 09:13AM " Only do this when not yet done for this buffer if exists("b:did_ftplugin") @@ -25,10 +25,27 @@ setlocal suffixesadd=.bib,.tex setlocal comments=b:%,b:#,b:##,b:###,b:#' if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . + let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" . \ "All Files (*.*)\t*.*\n" endif +function! SetRnwCommentStr() + if (search("^\s*<<.*>>=", "bncW") > search("^@", "bncW")) + set commentstring=#\ %s + else + set commentstring=%\ %s + endif +endfunction + +" If you do not want both 'comments' and 'commentstring' dynamically defined, +" put in your vimrc: let g:rnw_dynamic_comments = 0 +if !exists("g:rnw_dynamic_comments") || (exists("g:rnw_dynamic_comments") && g:rnw_dynamic_comments == 1) + augroup RnwCStr + autocmd! + autocmd CursorMoved call SetRnwCommentStr() + augroup END +endif + if exists('b:undo_ftplugin') let b:undo_ftplugin .= " | setl isk< sua< com< | unlet! b:browsefilter" else diff --git a/runtime/ftplugin/rrst.vim b/runtime/ftplugin/rrst.vim index a56fd6478e..19c67c4cc2 100644 --- a/runtime/ftplugin/rrst.vim +++ b/runtime/ftplugin/rrst.vim @@ -2,7 +2,7 @@ " Language: reStructuredText documentation format with R code " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Aug 15, 2020 12:02PM +" Last Change: Sun Apr 24, 2022 09:13AM " Original work by Alex Zvoleff " Only do this when not yet done for this buffer @@ -38,7 +38,7 @@ if !exists("g:rrst_dynamic_comments") || (exists("g:rrst_dynamic_comments") && g endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . + let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" . \ "All Files (*.*)\t*.*\n" endif -- cgit From 269dd747b6e61842856031ca14ac26ee884ede4c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 2 Apr 2023 23:01:48 +0800 Subject: refactor(defaults)!: change default 'commentstring' value to empty (#22862) --- runtime/ftplugin/c.lua | 1 + runtime/ftplugin/calender.lua | 1 + runtime/ftplugin/css.lua | 1 + runtime/ftplugin/indent.lua | 1 + runtime/ftplugin/xdefaults.lua | 1 + 5 files changed, 5 insertions(+) create mode 100644 runtime/ftplugin/c.lua create mode 100644 runtime/ftplugin/calender.lua create mode 100644 runtime/ftplugin/css.lua create mode 100644 runtime/ftplugin/indent.lua create mode 100644 runtime/ftplugin/xdefaults.lua (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/c.lua b/runtime/ftplugin/c.lua new file mode 100644 index 0000000000..b4e68148f5 --- /dev/null +++ b/runtime/ftplugin/c.lua @@ -0,0 +1 @@ +vim.bo.commentstring = '/*%s*/' diff --git a/runtime/ftplugin/calender.lua b/runtime/ftplugin/calender.lua new file mode 100644 index 0000000000..b4e68148f5 --- /dev/null +++ b/runtime/ftplugin/calender.lua @@ -0,0 +1 @@ +vim.bo.commentstring = '/*%s*/' diff --git a/runtime/ftplugin/css.lua b/runtime/ftplugin/css.lua new file mode 100644 index 0000000000..b4e68148f5 --- /dev/null +++ b/runtime/ftplugin/css.lua @@ -0,0 +1 @@ +vim.bo.commentstring = '/*%s*/' diff --git a/runtime/ftplugin/indent.lua b/runtime/ftplugin/indent.lua new file mode 100644 index 0000000000..b4e68148f5 --- /dev/null +++ b/runtime/ftplugin/indent.lua @@ -0,0 +1 @@ +vim.bo.commentstring = '/*%s*/' diff --git a/runtime/ftplugin/xdefaults.lua b/runtime/ftplugin/xdefaults.lua new file mode 100644 index 0000000000..b4e68148f5 --- /dev/null +++ b/runtime/ftplugin/xdefaults.lua @@ -0,0 +1 @@ +vim.bo.commentstring = '/*%s*/' -- cgit From f5231d61a5413e3ea45a060dd31e4537634f3d87 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 12 Apr 2023 13:59:11 +0200 Subject: fix(runtime): add commentstring for C# ftplugin (#23039) Problem: No commentstring is set for C# buffers after removing the default C-style commentstring Solution: Add `ftplugin/cs.lua` with C-style commentstring --- runtime/ftplugin/cs.lua | 1 + 1 file changed, 1 insertion(+) create mode 100644 runtime/ftplugin/cs.lua (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/cs.lua b/runtime/ftplugin/cs.lua new file mode 100644 index 0000000000..b4e68148f5 --- /dev/null +++ b/runtime/ftplugin/cs.lua @@ -0,0 +1 @@ +vim.bo.commentstring = '/*%s*/' -- cgit From e3f36377c156749bbdafc46d8a8cd017f378b4b5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 23 Apr 2023 15:22:55 +0200 Subject: vim-patch:71badf9547e8 (#23285) Update runtime files https://github.com/vim/vim/commit/71badf9547e8f89571b9a095183671cbb333d528 Co-authored-by: Bram Moolenaar --- runtime/ftplugin/livebook.vim | 9 +++++++++ runtime/ftplugin/lua.vim | 5 +++-- runtime/ftplugin/netrc.vim | 3 ++- runtime/ftplugin/rmd.vim | 6 +++--- runtime/ftplugin/rnoweb.vim | 8 ++++---- runtime/ftplugin/rrst.vim | 4 ++-- 6 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 runtime/ftplugin/livebook.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/livebook.vim b/runtime/ftplugin/livebook.vim new file mode 100644 index 0000000000..c97d210412 --- /dev/null +++ b/runtime/ftplugin/livebook.vim @@ -0,0 +1,9 @@ +" Placeholder livebook filetype plugin file. +" This simply uses the markdown filetype plugin. + +" Only load this plugin when no other was loaded. +if exists("b:did_ftplugin") + finish +endif + +runtime! ftplugin/markdown.vim ftplugin/markdown_*.vim ftplugin/markdown/*.vim diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim index 88b1fc9d44..3529e1e3fd 100644 --- a/runtime/ftplugin/lua.vim +++ b/runtime/ftplugin/lua.vim @@ -4,7 +4,8 @@ " Previous Maintainer: Max Ischenko " Contributor: Dorai Sitaram " C.D. MacEachern -" Last Change: 2022 Nov 19 +" Tyler Miller +" Last Change: 2023 Mar 24 if exists("b:did_ftplugin") finish @@ -14,7 +15,7 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -setlocal comments=:-- +setlocal comments=:---,:-- setlocal commentstring=--\ %s setlocal formatoptions-=t formatoptions+=croql diff --git a/runtime/ftplugin/netrc.vim b/runtime/ftplugin/netrc.vim index 02ee327295..5f40bec96e 100644 --- a/runtime/ftplugin/netrc.vim +++ b/runtime/ftplugin/netrc.vim @@ -2,6 +2,7 @@ " Language: netrc(5) configuration file " Previous Maintainer: Nikolai Weibull " Latest Revision: 2008-07-09 +" Last Change: 2023 Feb 27 by Keith Smiley if exists("b:did_ftplugin") finish @@ -13,7 +14,7 @@ set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" -setlocal comments= commentstring= formatoptions-=tcroq formatoptions+=l +setlocal comments=b:# commentstring=#\ %s formatoptions-=tcroq formatoptions+=l let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/rmd.vim b/runtime/ftplugin/rmd.vim index 355b88f04a..be6ab7335b 100644 --- a/runtime/ftplugin/rmd.vim +++ b/runtime/ftplugin/rmd.vim @@ -2,7 +2,7 @@ " Language: R Markdown file " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sun Apr 24, 2022 09:12AM +" Last Change: Mon Feb 27, 2023 07:15PM " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann) " Only do this when not yet done for this buffer @@ -23,7 +23,7 @@ setlocal iskeyword=@,48-57,_,. let s:cpo_save = &cpo set cpo&vim -function! FormatRmd() +function FormatRmd() if search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW") setlocal comments=:#',:###,:##,:# else @@ -32,7 +32,7 @@ function! FormatRmd() return 1 endfunction -function! SetRmdCommentStr() +function SetRmdCommentStr() if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW')) set commentstring=#\ %s else diff --git a/runtime/ftplugin/rnoweb.vim b/runtime/ftplugin/rnoweb.vim index cf1c0922c0..26c1ab4e3f 100644 --- a/runtime/ftplugin/rnoweb.vim +++ b/runtime/ftplugin/rnoweb.vim @@ -2,7 +2,7 @@ " Language: Rnoweb " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sun Apr 24, 2022 09:13AM +" Last Change: Mon Feb 27, 2023 07:16PM " Only do this when not yet done for this buffer if exists("b:did_ftplugin") @@ -29,7 +29,7 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") \ "All Files (*.*)\t*.*\n" endif -function! SetRnwCommentStr() +function SetRnwCommentStr() if (search("^\s*<<.*>>=", "bncW") > search("^@", "bncW")) set commentstring=#\ %s else @@ -47,9 +47,9 @@ if !exists("g:rnw_dynamic_comments") || (exists("g:rnw_dynamic_comments") && g:r endif if exists('b:undo_ftplugin') - let b:undo_ftplugin .= " | setl isk< sua< com< | unlet! b:browsefilter" + let b:undo_ftplugin .= " | setl isk< sua< com< cms< | unlet! b:browsefilter" else - let b:undo_ftplugin = "setl isk< sua< com< | unlet! b:browsefilter" + let b:undo_ftplugin = "setl isk< sua< com< cms< | unlet! b:browsefilter" endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/rrst.vim b/runtime/ftplugin/rrst.vim index 19c67c4cc2..d9df5e587f 100644 --- a/runtime/ftplugin/rrst.vim +++ b/runtime/ftplugin/rrst.vim @@ -2,7 +2,7 @@ " Language: reStructuredText documentation format with R code " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sun Apr 24, 2022 09:13AM +" Last Change: Mon Feb 27, 2023 07:16PM " Original work by Alex Zvoleff " Only do this when not yet done for this buffer @@ -22,7 +22,7 @@ setlocal formatoptions+=tcqln setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+ setlocal iskeyword=@,48-57,_,. -function! FormatRrst() +function FormatRrst() if search('^\.\. {r', "bncW") > search('^\.\. \.\.$', "bncW") setlocal comments=:#',:###,:##,:# else -- cgit From c194acbfc479d8e5839fa629363f93f6550d035c Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Sat, 29 Apr 2023 18:22:26 +0200 Subject: feat(treesitter): add query_linter from nvim-treesitter/playground (#22784) Co-authored-by: clason Co-authored-by: lewis6991 --- runtime/ftplugin/query.lua | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index 3b99d67247..842d338fd9 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -1,6 +1,30 @@ -- Neovim filetype plugin file -- Language: Tree-sitter query --- Last Change: 2022 Mar 29 +-- Last Change: 2022 Apr 25 + +if vim.b.did_ftplugin == 1 then + return +end + +-- Do not set vim.b.did_ftplugin = 1 to allow loading of ftplugin/lisp.vim + +-- use treesitter over syntax +vim.treesitter.start() + +-- query linter +local buf = vim.api.nvim_get_current_buf() +local query_lint_on = vim.g.query_lint_on or { 'BufEnter', 'BufWrite' } + +if not vim.b.disable_query_linter and #query_lint_on > 0 then + vim.api.nvim_create_autocmd(query_lint_on, { + group = vim.api.nvim_create_augroup('querylint', { clear = false }), + buffer = buf, + callback = function() + vim.treesitter.query.lint(buf) + end, + desc = 'Query linter', + }) +end -- it's a lisp! vim.cmd([[ runtime! ftplugin/lisp.vim ]]) -- cgit From 668f16bac779ac52d7bd9452e6001a7a6d1e9965 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 30 Apr 2023 11:01:54 +0200 Subject: feat(treesitter): upstream query omnifunc from playground (#23394) and set by default in `ftplugin/query.lua` --- runtime/ftplugin/query.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index 842d338fd9..accf38c199 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -11,6 +11,9 @@ end -- use treesitter over syntax vim.treesitter.start() +-- set omnifunc +vim.bo.omnifunc = 'v:lua.vim.treesitter.query.omnifunc' + -- query linter local buf = vim.api.nvim_get_current_buf() local query_lint_on = vim.g.query_lint_on or { 'BufEnter', 'BufWrite' } -- cgit From c11986ed1a816d7ebcb5a5f707e3ef884f278293 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 15 May 2023 09:38:32 +0200 Subject: vim-patch:b7398fe41c9e (#23627) Update runtime files https://github.com/vim/vim/commit/b7398fe41c9e1e731d058105a34158871ee83e3f Co-authored-by: Bram Moolenaar --- runtime/ftplugin/luau.vim | 14 ++++++++++++++ runtime/ftplugin/usd.vim | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 runtime/ftplugin/luau.vim create mode 100644 runtime/ftplugin/usd.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/luau.vim b/runtime/ftplugin/luau.vim new file mode 100644 index 0000000000..458d0b05a9 --- /dev/null +++ b/runtime/ftplugin/luau.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin file +" Language: Luau +" Maintainer: None yet +" Last Change: 2023 Apr 30 + +if exists("b:did_ftplugin") + finish +endif + +" Luau is a superset of Lua +runtime! ftplugin/lua.vim + + +" vim: nowrap sw=2 sts=2 ts=8 diff --git a/runtime/ftplugin/usd.vim b/runtime/ftplugin/usd.vim new file mode 100644 index 0000000000..c795ba591b --- /dev/null +++ b/runtime/ftplugin/usd.vim @@ -0,0 +1,18 @@ +" Vim filetype plugin file +" Language: Pixar Animation's Universal Scene Description format +" Maintainer: Colin Kennedy +" Last Change: 2023 May 9 + +if exists("b:did_ftplugin") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +let b:did_ftplugin = 1 + +setlocal commentstring=#\ %s + +let &cpo = s:cpo_save +unlet s:cpo_save -- cgit From 4382d2ed564b80944345785d780cf1b19fb23ba8 Mon Sep 17 00:00:00 2001 From: Alexandre Teoi Date: Tue, 6 Jun 2023 12:42:26 -0300 Subject: feat(health): fold successful healthchecks #22866 Problem: checkhealth can be noisy, but we don't want to omit info. Solution: Fold OK results by default, if 'foldenable' is enabled. Resolves #22796 --- runtime/ftplugin/checkhealth.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/checkhealth.vim b/runtime/ftplugin/checkhealth.vim index 62a1970b4a..4b530e6f7c 100644 --- a/runtime/ftplugin/checkhealth.vim +++ b/runtime/ftplugin/checkhealth.vim @@ -9,6 +9,9 @@ endif runtime! ftplugin/help.vim setlocal wrap breakindent linebreak +setlocal foldexpr=getline(v:lnum-1)=~'^=\\{78}$'?'>1':(getline(v:lnum)=~'^=\\{78}'?0:'=') +setlocal foldmethod=expr +setlocal foldtext=v:lua.require('vim.health').foldtext() let &l:iskeyword='!-~,^*,^|,^",192-255' if exists("b:undo_ftplugin") -- cgit From fcfe535e9877cfdc824dc78f2d19e590400d34cd Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Tue, 6 Jun 2023 11:26:29 -0500 Subject: refactor(defaults): do not use C specific default values for options (#22500) The options 'path', 'include', and 'define' all use C-specific default values. This may have made sense a long time ago when Vim was mostly used just for writing C, but this is no longer the case, and we have ample support for filetype specific configuration. Make the default values of these options empty and move the C-specific values into a filetype plugin where they belong. Co-authored-by: zeertzjq --- runtime/ftplugin/c.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/c.lua b/runtime/ftplugin/c.lua index b4e68148f5..0ddbf09470 100644 --- a/runtime/ftplugin/c.lua +++ b/runtime/ftplugin/c.lua @@ -1 +1,14 @@ +-- These are the default option values in Vim, but not in Nvim, so must be set explicitly. vim.bo.commentstring = '/*%s*/' +vim.bo.define = '^\\s*#\\s*define' +vim.bo.include = '^\\s*#\\s*include' + +if vim.fn.isdirectory('/usr/include') == 1 then + vim.cmd([[ + setlocal path^=/usr/include + setlocal path-=. + setlocal path^=. + ]]) +end + +vim.b.undo_ftplugin = vim.b.undo_ftplugin .. '|setl path<' -- cgit From 473a216a21fdc086ef71e0ca7d40c2fdf5346245 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sun, 11 Jun 2023 12:40:22 +0100 Subject: vim-patch:10e8ff9b2607 (#23977) Update runtime files https://github.com/vim/vim/commit/10e8ff9b26078994cae57c2422b145d37aaf714e Also: - fix a missing `<` in builtin.txt. - edit `:function` `{name}` wording to match the change made for the docs above by Justin in #10619. - link to `*vimrc*` rather than `*init.vim*` in repeat.txt change (as `init.lua` may also be used). Co-authored-by: Bram Moolenaar --- runtime/ftplugin/corn.vim | 18 ++++++++++++++++++ runtime/ftplugin/fennel.vim | 4 ++-- runtime/ftplugin/urlshortcut.vim | 20 ++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 runtime/ftplugin/corn.vim create mode 100644 runtime/ftplugin/urlshortcut.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/corn.vim b/runtime/ftplugin/corn.vim new file mode 100644 index 0000000000..2259442229 --- /dev/null +++ b/runtime/ftplugin/corn.vim @@ -0,0 +1,18 @@ +" Vim filetype plugin +" Language: Corn +" Original Author: Jake Stanger (mail@jstanger.dev) +" License: MIT +" Last Change: 2023 May 28 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal formatoptions-=t + +" Set comment (formatting) related options. +setlocal commentstring=//\ %s comments=:// + +" Let Vim know how to disable the plug-in. +let b:undo_ftplugin = 'setlocal commentstring< comments< formatoptions<' diff --git a/runtime/ftplugin/fennel.vim b/runtime/ftplugin/fennel.vim index 2e502699c5..93cf366726 100644 --- a/runtime/ftplugin/fennel.vim +++ b/runtime/ftplugin/fennel.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Fennel " Maintainer: Gregory Anders -" Last Update: 2022 Apr 20 +" Last Update: 2023 Jun 9 if exists('b:did_ftplugin') finish @@ -13,6 +13,6 @@ setlocal comments=:;;,:; setlocal formatoptions-=t setlocal suffixesadd=.fnl setlocal lisp -setlocal lispwords=accumulate,collect,do,doto,each,eval-compiler,fn,for,icollect,lambda,let,macro,macros,match,match-try,when,while,with-open +setlocal lispwords=accumulate,case,case-try,collect,do,doto,each,eval-compiler,faccumulate,fcollect,fn,for,icollect,lambda,let,macro,macros,match,match-try,when,while,with-open let b:undo_ftplugin = 'setlocal commentstring< comments< formatoptions< suffixesadd< lisp< lispwords<' diff --git a/runtime/ftplugin/urlshortcut.vim b/runtime/ftplugin/urlshortcut.vim new file mode 100644 index 0000000000..ebe08ac1d8 --- /dev/null +++ b/runtime/ftplugin/urlshortcut.vim @@ -0,0 +1,20 @@ +" Vim filetype plugin file +" Language: MS Windows URL shortcut file +" Maintainer: ObserverOfTime +" Latest Revision: 2023-06-04 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpoptions +set cpoptions&vim + +let b:undo_ftplugin = "setl com< cms< fo<" + +setlocal comments=:; commentstring=;\ %s +setlocal formatoptions-=t formatoptions+=croql + +let &cpoptions = s:cpo_save +unlet s:cpo_save -- cgit From aaeb1a8cd18741ff17fd030eb05a132bb9f99430 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 9 Aug 2023 22:34:02 +0200 Subject: vim-patch:7159ac7fec28 (#24624) Unison support (vim/vim#12715) https://github.com/vim/vim/commit/7159ac7fec282ad7427795b4bcd5b769268c083d Co-authored-by: Anton Parkhomenko --- runtime/ftplugin/unison.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 runtime/ftplugin/unison.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/unison.vim b/runtime/ftplugin/unison.vim new file mode 100644 index 0000000000..76dbaef6aa --- /dev/null +++ b/runtime/ftplugin/unison.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin file +" Language: unison +" Maintainer: Anton Parkhomenko +" Latest Revision: 2023-08-07 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setl cms< isk<" + +setlocal commentstring=--\ %s +setlocal iskeyword+=!,' -- cgit From 1904e5060edca066aa7ea0a9c470f5842a38d541 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 9 Aug 2023 22:34:54 +0200 Subject: vim-patch:8967f6c4b9e2 (#24626) feat(heex): borrow matchit support from html (vim/vim#12717) * feat(heex): borrow matchit support from html Makes % support behave the same in heex as in html. For example, quickly moving the cursor between opening and closing tags. * Remove unnecessary line; define b:undo_ftplugin first * Remove b:html_set_match_words https://github.com/vim/vim/commit/8967f6c4b9e2071dea9a63dbbbb93f6b9119ae99 Co-authored-by: Chris Vincent --- runtime/ftplugin/heex.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/heex.vim b/runtime/ftplugin/heex.vim index 5274d59fbf..f79c69d2aa 100644 --- a/runtime/ftplugin/heex.vim +++ b/runtime/ftplugin/heex.vim @@ -14,3 +14,14 @@ setlocal comments=:<%!-- setlocal commentstring=<%!--\ %s\ --%> let b:undo_ftplugin = 'set sw< sts< et< com< cms<' + +" HTML: thanks to Johannes Zellner and Benji Fisher. +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_ignorecase = 1 + let b:match_words = ',' .. + \ '<:>,' .. + \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .. + \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .. + \ '<\@<=\([^/!][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" +endif -- cgit From 278805dfacc865c594c383f6f1fb7eeaf307aa15 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 11 Aug 2023 19:55:10 +0200 Subject: vim-patch:21aaff3faa82 Update my name and email in runtime files (vim/vim#12763) https://github.com/vim/vim/commit/21aaff3faa828c5c2677a0a9f1b90a0b780d57f6 Co-authored-by: Lily Ballard --- runtime/ftplugin/rust.vim | 2 +- runtime/ftplugin/toml.vim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/rust.vim b/runtime/ftplugin/rust.vim index 7efca5985b..ececcced22 100644 --- a/runtime/ftplugin/rust.vim +++ b/runtime/ftplugin/rust.vim @@ -1,7 +1,7 @@ " Language: Rust " Description: Vim ftplugin for Rust " Maintainer: Chris Morgan -" Maintainer: Kevin Ballard +" Maintainer: Lily Ballard " Last Change: June 08, 2016 " For bugs, patches and license go to https://github.com/rust-lang/rust.vim diff --git a/runtime/ftplugin/toml.vim b/runtime/ftplugin/toml.vim index 1ef09a16e3..6bd79b1c0a 100644 --- a/runtime/ftplugin/toml.vim +++ b/runtime/ftplugin/toml.vim @@ -2,7 +2,7 @@ " Language: TOML " Homepage: https://github.com/cespare/vim-toml " Maintainer: Aman Verma -" Author: Kevin Ballard +" Author: Lily Ballard " Last Change: Sep 21, 2021 if exists('b:did_ftplugin') -- cgit From 04aed08157e324669f70fb0e90be38722332b3e1 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 11 Aug 2023 23:13:39 +0200 Subject: vim-patch:d8f981138aa0 Add commentstring for nix file format (vim/vim#12696) https://github.com/vim/vim/commit/d8f981138aa04c15ff87b306e9003df8d4b09d17 Co-authored-by: Keith Smiley --- runtime/ftplugin/nix.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 runtime/ftplugin/nix.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/nix.vim b/runtime/ftplugin/nix.vim new file mode 100644 index 0000000000..d417cc7805 --- /dev/null +++ b/runtime/ftplugin/nix.vim @@ -0,0 +1,17 @@ +" Vim filetype plugin +" Language: nix +" Maintainer: Keith Smiley +" Last Change: 2023 Jul 22 + +" 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 b:undo_ftplugin = "setl commentstring< comments<" + +setlocal comments=:# +setlocal commentstring=#\ %s -- cgit From a600ac5263b202f6883ef1e7406b4475bd1e136d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 13 Aug 2023 11:16:10 +0200 Subject: vim-patch:2f339aad6c80 Add syntax & ftplugin for pymanifest (vim/vim#12773) https://github.com/vim/vim/commit/2f339aad6c80e82d7c1237b402392065857174d4 Co-authored-by: ObserverOfTime --- runtime/ftplugin/pymanifest.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 runtime/ftplugin/pymanifest.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/pymanifest.vim b/runtime/ftplugin/pymanifest.vim new file mode 100644 index 0000000000..a77e956ae5 --- /dev/null +++ b/runtime/ftplugin/pymanifest.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: PyPA manifest +" Maintainer: ObserverOfTime +" Last Change: 2023 Aug 08 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' -- cgit From cbf54ec2a5aaa1a00ff89e26bab44a30d09d4631 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Sun, 13 Aug 2023 13:25:10 +0100 Subject: vim-patch:e978b4534a5e (#24697) Farewell to Bram and dedicate upcoming Vim 9.1 to him (vim/vim#12749) https://github.com/vim/vim/commit/e978b4534a5e10471108259118c0ef791106fd92 Also update the header for the following files that were converted to Vim9 script upstream: - autoload/ccomplete.lua (vim9jitted) - ftplugin.vim - ftplugof.vim - indent.vim - indent/vim.vim - makemenu.vim This also updates the "Last Change" dates, even if some changes (due to rewrites to Vim9 script) were not ported. There's still a few other places where Bram is still mentioned as a maintainer in the files we and Vim have: - ftplugin/bash.vim - indent/bash.vim - indent/html.vim - indent/mail.vim - macros/accents.vim - macros/editexisting.vim - syntax/bash.vim - syntax/shared/typescriptcommon.vim - syntax/tar.vim - syntax/typescript.vim - syntax/typescriptreact.vim - syntax/zimbu.vim Maybe future patches will address that. Also exclude changes to .po files that didn't apply automatically (the `:messages` maintainer string isn't used in Nvim anyway). Co-authored-by: Christian Brabandt --- runtime/ftplugin/aap.vim | 5 +++-- runtime/ftplugin/btm.vim | 5 +++-- runtime/ftplugin/c.vim | 5 +++-- runtime/ftplugin/cpp.vim | 5 +++-- runtime/ftplugin/diff.vim | 5 +++-- runtime/ftplugin/mail.vim | 5 +++-- runtime/ftplugin/make.vim | 5 +++-- runtime/ftplugin/objc.vim | 5 +++-- runtime/ftplugin/vim.vim | 5 +++-- runtime/ftplugin/zimbu.vim | 5 +++-- 10 files changed, 30 insertions(+), 20 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/aap.vim b/runtime/ftplugin/aap.vim index b5065e5157..df839c99ae 100644 --- a/runtime/ftplugin/aap.vim +++ b/runtime/ftplugin/aap.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: Aap recipe -" Maintainer: Bram Moolenaar -" Last Change: 2021 Nov 14 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/btm.vim b/runtime/ftplugin/btm.vim index d3dc5b75f5..1c2c68599d 100644 --- a/runtime/ftplugin/btm.vim +++ b/runtime/ftplugin/btm.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: BTM -" Maintainer: Bram Moolenaar -" Last Change: 2004 Jul 06 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index cfaf26f66c..83fb9ead68 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: C -" Maintainer: Bram Moolenaar -" Last Change: 2022 Apr 08 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/cpp.vim b/runtime/ftplugin/cpp.vim index 58c4e4b24a..cb425aa8e7 100644 --- a/runtime/ftplugin/cpp.vim +++ b/runtime/ftplugin/cpp.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: C++ -" Maintainer: Bram Moolenaar -" Last Change: 2020 Jul 26 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/diff.vim b/runtime/ftplugin/diff.vim index bf37d464c0..f2a0820be9 100644 --- a/runtime/ftplugin/diff.vim +++ b/runtime/ftplugin/diff.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: Diff -" Maintainer: Bram Moolenaar -" Last Change: 2021 Nov 14 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/mail.vim b/runtime/ftplugin/mail.vim index f12022305f..3cef84f528 100644 --- a/runtime/ftplugin/mail.vim +++ b/runtime/ftplugin/mail.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: Mail -" Maintainer: Bram Moolenaar -" Last Change: 2021 Oct 23 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/make.vim b/runtime/ftplugin/make.vim index 168bc38eb3..7227bb3739 100644 --- a/runtime/ftplugin/make.vim +++ b/runtime/ftplugin/make.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: Make -" Maintainer: Bram Moolenaar -" Last Change: 2020 Oct 16 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/objc.vim b/runtime/ftplugin/objc.vim index e41beb5dad..d129b33c1c 100644 --- a/runtime/ftplugin/objc.vim +++ b/runtime/ftplugin/objc.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: Objective C -" Maintainer: Bram Moolenaar -" Last Change: 2003 Jan 15 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index a2cbc28971..3b10c95c80 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,8 @@ " Vim filetype plugin " Language: Vim -" Maintainer: Bram Moolenaar -" Last Change: 2023 Feb 07 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/zimbu.vim b/runtime/ftplugin/zimbu.vim index cbe2f55572..94d6be758d 100644 --- a/runtime/ftplugin/zimbu.vim +++ b/runtime/ftplugin/zimbu.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: Zimbu -" Maintainer: Bram Moolenaar -" Last Change: 2022 Sep 07 +" Maintainer: The Vim Project +" Last Change: 2023 Aug 10 +" Former Maintainer: Bram Moolenaar " Only do this when not done yet for this buffer if exists("b:did_ftplugin") -- cgit From 18062f70d81ee8d3d9dcad2fe3afe8e2431cbbdf Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 20 Aug 2023 10:48:07 +0900 Subject: vim-patch:56bafd7a6a79 Runtime: add new sed ftplugin (vim/vim#12843) https://github.com/vim/vim/commit/56bafd7a6a79203b86f7165a7bbac5730c170f64 Co-authored-by: dkearns --- runtime/ftplugin/sed.vim | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 runtime/ftplugin/sed.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/sed.vim b/runtime/ftplugin/sed.vim new file mode 100644 index 0000000000..0073872877 --- /dev/null +++ b/runtime/ftplugin/sed.vim @@ -0,0 +1,29 @@ +" Vim filetype plugin file +" Language: sed +" Maintainer: Doug Kearns +" Last Change: 2020 Apr 1 + +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 com< cms< fo<" + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "sed Script Files (*.sed)\t*.sed\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 -- cgit From a5b6468e9bc19d3e01846c9a6a47a766b8b81a5a Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 21 Aug 2023 09:46:44 +0900 Subject: vim-patch:9.0.1766: Runtime: Missing QML support Problem: Runtime: Missing QML support Solution: Add QML support to Vim closes: vim/vim#12810 https://github.com/vim/vim/commit/bedc69f9d67b117ab05aa735c701cd3899d1ae2d Co-authored-by: ChaseKnowlden --- runtime/ftplugin/qml.vim | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 runtime/ftplugin/qml.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/qml.vim b/runtime/ftplugin/qml.vim new file mode 100644 index 0000000000..fd5ddbb4bc --- /dev/null +++ b/runtime/ftplugin/qml.vim @@ -0,0 +1,31 @@ +" Vim filetype plugin file +" Language: QML +" Maintainer: Chase Knowlden +" Last Change: 2023 Aug 16 + +if exists( 'b:did_ftplugin' ) + finish +endif +let b:did_ftplugin = 1 + +let s:cpoptions_save = &cpoptions +set cpoptions&vim + +" command for undo +let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring<" + +if (has("gui_win32") || has("gui_gtk")) && !exists( 'b:browsefilter' ) + let b:browsefilter = + \ 'QML Files (*.qml,*.qbs)\t*.qml;*.qbs\n' . + \ 'All Files\t*\n' +endif + +" Set 'comments' to format dashed lists in comments. +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// +setlocal commentstring=//%s + +setlocal formatoptions-=t +setlocal formatoptions+=croql + +let &cpoptions = s:cpoptions_save +unlet s:cpoptions_save -- cgit From 36404fea4a3cb87d816359564bde774b9e60a899 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 21 Aug 2023 09:55:12 +0900 Subject: vim-patch:5e6e4042b1c9 runtime(haskell): Add single quote to `iskeyword` in ftplugin (vim/vim#8191) The single quote `'` is a valid character in variable names, so it should be included in `iskeyword`; this, for instance, makes the * command behave predictably https://github.com/vim/vim/commit/5e6e4042b1c9685bce86493e3ee6fe916a7f221c Co-authored-by: Enrico Maria De Angelis --- runtime/ftplugin/haskell.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/haskell.vim b/runtime/ftplugin/haskell.vim index 84f4d0563b..2a864bf916 100644 --- a/runtime/ftplugin/haskell.vim +++ b/runtime/ftplugin/haskell.vim @@ -17,6 +17,7 @@ let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=s1fl:{-,mb:-,ex:-},:-- commentstring=--\ %s setlocal formatoptions-=t formatoptions+=croql setlocal omnifunc=haskellcomplete#Complete +setlocal iskeyword+=' let &cpo = s:cpo_save unlet s:cpo_save -- cgit From 23cc36bd99a4e16a0d9d24c7fca62554211a5b1d Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Wed, 23 Aug 2023 20:31:48 +0100 Subject: vim-patch:e8d6f03f6a61 runtime: Remove Brams name from a few more runtime files (vim/vim#12780) syntax/model.vim: minor wording improvement https://github.com/vim/vim/commit/e8d6f03f6a61f60de6893253621d057f63dd6a23 Use the updated "Last Change" date for all. Co-authored-by: Christian Brabandt Co-authored-by: Adri Verhoef --- runtime/ftplugin/bash.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/bash.vim b/runtime/ftplugin/bash.vim index 7bd9787b6c..7be1eca2a9 100644 --- a/runtime/ftplugin/bash.vim +++ b/runtime/ftplugin/bash.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: bash -" Maintainer: Bram Moolenaar -" Last Changed: 2019 Jan 12 +" Maintainer: The Vim Project +" Last Changed: 2023 Aug 13 " " This is not a real filetype plugin. It allows for someone to set 'filetype' " to "bash" in the modeline, and gets the effect of filetype "sh" with -- cgit From 0b7e1730bcd4c6ec1b55d541bc612445a4ff0c65 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 23 Aug 2023 10:09:32 +0900 Subject: vim-patch:e34b51e95fd0 runtime(solidity): add new ftplugin (vim/vim#12877) Set undo_{ftplugin,indent} closes vim/vim#11240 https://github.com/vim/vim/commit/e34b51e95fd0ea7b0e34a625db0f9ed7e051e0dd Co-authored-by: dkearns Co-authored-by: cothi --- runtime/ftplugin/solidity.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 runtime/ftplugin/solidity.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/solidity.vim b/runtime/ftplugin/solidity.vim new file mode 100644 index 0000000000..abe9f2ff26 --- /dev/null +++ b/runtime/ftplugin/solidity.vim @@ -0,0 +1,15 @@ +" Vim filetype plugin file +" Language: Solidity +" Maintainer: Cothi (jiungdev@gmail.com) +" Original Author: tomlion (https://github.com/tomlion/vim-solidity) +" Last Change: 2022 Sep 27 +" 2023 Aug 22 Vim Project (did_ftplugin, undo_ftplugin) + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal commentstring=//\ %s + +let b:undo_ftplugin = "setlocal commentstring<" -- cgit From 327e3fab9e66701334a55dd7893283acb85899a2 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 24 Aug 2023 09:07:35 +0900 Subject: vim-patch:3fc7a7e44abd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runtime: Fix typos in various files closes: vim/vim#12836 https://github.com/vim/vim/commit/3fc7a7e44abda6505ccd39a6d067db6e5173cbf6 Co-authored-by: Viktor Szépe --- runtime/ftplugin/debchangelog.vim | 2 +- runtime/ftplugin/readline.vim | 2 +- runtime/ftplugin/rst.vim | 2 +- runtime/ftplugin/sql.vim | 4 ++-- runtime/ftplugin/tidy.vim | 2 +- runtime/ftplugin/zig.vim | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim index 062fc054c8..dca7f7355a 100644 --- a/runtime/ftplugin/debchangelog.vim +++ b/runtime/ftplugin/debchangelog.vim @@ -122,7 +122,7 @@ function NewVersion() normal! 1G0 call search(')') normal! h - " ':normal' doens't support key annotation () directly. + " ':normal' doesn't support key annotation () directly. " Vim's manual recommends using ':exe' to use key annotation indirectly (backslash-escaping needed though). exe "normal! \" call setline(1, substitute(getline(1), '-\$\$', '-', '')) diff --git a/runtime/ftplugin/readline.vim b/runtime/ftplugin/readline.vim index eba7122347..524eeb736a 100644 --- a/runtime/ftplugin/readline.vim +++ b/runtime/ftplugin/readline.vim @@ -25,7 +25,7 @@ if exists("loaded_matchit") && !exists("b:match_words") endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "Readline Intialization Files (inputrc .inputrc)\tinputrc;*.inputrc\n" .. + let b:browsefilter = "Readline Initialization Files (inputrc .inputrc)\tinputrc;*.inputrc\n" .. \ "All Files (*.*)\t*.*\n" let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif diff --git a/runtime/ftplugin/rst.vim b/runtime/ftplugin/rst.vim index ff7a402d10..c88e8f2580 100644 --- a/runtime/ftplugin/rst.vim +++ b/runtime/ftplugin/rst.vim @@ -28,7 +28,7 @@ setlocal formatoptions+=tcroql " directives (..) and ordered lists (1.), although it can cause problems for " many other cases. " -" More sophisticated indentation rules should be revisted in the future. +" More sophisticated indentation rules should be revisited in the future. if exists("g:rst_style") && g:rst_style != 0 setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8 diff --git a/runtime/ftplugin/sql.vim b/runtime/ftplugin/sql.vim index 1c02a98c7c..7a29d39f8e 100644 --- a/runtime/ftplugin/sql.vim +++ b/runtime/ftplugin/sql.vim @@ -140,7 +140,7 @@ if !exists("*SQL_SetType") \ ) " Remove duplicates, since sqlanywhere.vim can exist in the - " sytax, indent and ftplugin directory, yet we only want + " syntax, indent and ftplugin directory, yet we only want " to display the option once let index = match(sqls, '.\{-}\ze\n') while index > -1 @@ -204,7 +204,7 @@ if !exists("*SQL_SetType") endif let b:sql_type_override = new_sql_type - " Remove any cached SQL since a new sytax will have different + " Remove any cached SQL since a new syntax will have different " items and groups if !exists('g:loaded_sql_completion') || g:loaded_sql_completion >= 100 call sqlcomplete#ResetCacheSyntax() diff --git a/runtime/ftplugin/tidy.vim b/runtime/ftplugin/tidy.vim index 470548d83a..b81b66db4a 100644 --- a/runtime/ftplugin/tidy.vim +++ b/runtime/ftplugin/tidy.vim @@ -1,5 +1,5 @@ " Vim filetype plugin file -" Language: HMTL Tidy Configuration +" Language: HTML Tidy Configuration " Maintainer: Doug Kearns " Last Change: 2020 Sep 4 diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim index e740a52849..5f453fc8d1 100644 --- a/runtime/ftplugin/zig.vim +++ b/runtime/ftplugin/zig.vim @@ -17,7 +17,7 @@ compiler zig_build " Match Zig builtin fns setlocal iskeyword+=@-@ -" Recomended code style, no tabs and 4-space indentation +" Recommended code style, no tabs and 4-space indentation setlocal expandtab setlocal tabstop=8 setlocal softtabstop=4 -- cgit From e2c10dea19a329f7913eb1d6110f10ec4bc525f9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 24 Aug 2023 09:08:24 +0900 Subject: vim-patch:2f25e40b1f54 runtime: configure keywordpg for some file types (vim/vim#5566) https://github.com/vim/vim/commit/2f25e40b1f545f4aa38377f0c25effb112b5d1ef Co-authored-by: Enno --- runtime/ftplugin/gpg.vim | 17 ++++++++++++++ runtime/ftplugin/modconf.vim | 16 +++++++++++++ runtime/ftplugin/muttrc.vim | 16 +++++++++++++ runtime/ftplugin/readline.vim | 16 +++++++++++++ runtime/ftplugin/sh.vim | 13 +++++++++++ runtime/ftplugin/sshconfig.vim | 25 ++++++++++++++++---- runtime/ftplugin/sudoers.vim | 16 +++++++++++++ runtime/ftplugin/systemd.vim | 53 +++++++++++++++++++----------------------- runtime/ftplugin/udevrules.vim | 16 +++++++++++++ 9 files changed, 154 insertions(+), 34 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/gpg.vim b/runtime/ftplugin/gpg.vim index 3f890e58f6..9e00daed6a 100644 --- a/runtime/ftplugin/gpg.vim +++ b/runtime/ftplugin/gpg.vim @@ -15,5 +15,22 @@ let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+--' . . '\b'' --hilite-search" man ' . 'gpg' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . . '\b', '\') . ''' --hilite-search" man ' . 'gpg' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save + diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim index c8e76b538b..09ad54b64a 100644 --- a/runtime/ftplugin/modconf.vim +++ b/runtime/ftplugin/modconf.vim @@ -16,5 +16,21 @@ let b:undo_ftplugin = "setl com< cms< inc< fo<" setlocal comments=:# commentstring=#\ %s include=^\\s*include setlocal formatoptions-=t formatoptions+=croql +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . . '\b'' --hilite-search" man ' . 'modprobe.d' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/muttrc.vim b/runtime/ftplugin/muttrc.vim index c8ad0f2ec5..bd01367158 100644 --- a/runtime/ftplugin/muttrc.vim +++ b/runtime/ftplugin/muttrc.vim @@ -18,5 +18,21 @@ setlocal formatoptions-=t formatoptions+=croql let &l:include = '^\s*source\>' +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . . '\b'' --hilite-search" man ' . 'muttrc' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . . '\b', '\') . ''' --hilite-search" man ' . 'muttrc' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/readline.vim b/runtime/ftplugin/readline.vim index 524eeb736a..c81d0f2f65 100644 --- a/runtime/ftplugin/readline.vim +++ b/runtime/ftplugin/readline.vim @@ -30,6 +30,22 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . . '\b'' --hilite-search" man ' . '3 readline' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . . '\b', '\') . ''' --hilite-search" man ' . '3 readline' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim index b6fdb8f3e2..7106bf9155 100644 --- a/runtime/ftplugin/sh.vim +++ b/runtime/ftplugin/sh.vim @@ -41,6 +41,19 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif +if (exists('b:is_bash') && (b:is_bash == 1)) || + \ (exists('b:is_sh') && (b:is_sh == 1)) + if !has('gui_running') && executable('less') + command! -buffer -nargs=1 Help silent exe '!bash -c "{ help "" 2>/dev/null || man ""; } | LESS= less"' | redraw! + elseif has('terminal') + command! -buffer -nargs=1 Help silent exe ':term bash -c "help "" 2>/dev/null || man """' + else + command! -buffer -nargs=1 Help echo system('bash -c "help " 2>/dev/null || man ""') + endif + setlocal keywordprg=:Help + let b:undo_ftplugin .= '| setlocal keywordprg<' +endif + " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo diff --git a/runtime/ftplugin/sshconfig.vim b/runtime/ftplugin/sshconfig.vim index d933ce0527..214e4928a0 100644 --- a/runtime/ftplugin/sshconfig.vim +++ b/runtime/ftplugin/sshconfig.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file -" Language: OpenSSH client configuration file -" Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" Language: OpenSSH client configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish @@ -11,9 +11,24 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -let b:undo_ftplugin = "setl com< cms< fo<" - setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql +let b:undo_ftplugin = 'setlocal com< cms< fo<' + +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . . '$'' --hilite-search" man ' . 'ssh_config' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . . '$', '\') . ''' --hilite-search" man ' . 'ssh_config' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/sudoers.vim b/runtime/ftplugin/sudoers.vim index 38dbf559ee..65cf2d8203 100644 --- a/runtime/ftplugin/sudoers.vim +++ b/runtime/ftplugin/sudoers.vim @@ -15,5 +15,21 @@ let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''\b' . . '\b'' --hilite-search" man ' . 'sudoers' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . . '\b', '\') . ''' --hilite-search" man ' . 'sudoers' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/systemd.vim b/runtime/ftplugin/systemd.vim index 4c5c9a1dc1..c0bc6302f2 100644 --- a/runtime/ftplugin/systemd.vim +++ b/runtime/ftplugin/systemd.vim @@ -7,35 +7,30 @@ if !exists('b:did_ftplugin') runtime! ftplugin/dosini.vim endif -if !has('unix') - finish -endif - -if !has('gui_running') - command! -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd() | redraw! -elseif has('terminal') - command! -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd() -else - finish -endif - -if !exists('*KeywordLookup_systemd') - function KeywordLookup_systemd(keyword) abort - let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$') - if len(matches) > 1 - let section = matches[1] - return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd() | redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd() + endif + if exists(':Sman') == 2 + if !exists('*KeywordLookup_systemd') + function KeywordLookup_systemd(keyword) abort + let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$') + if len(matches) > 1 + let section = matches[1] + return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section + else + return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd' + endif + endfunction + endif + setlocal iskeyword+=- + setlocal keywordprg=:Sman + if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) + let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<' else - return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' endif - endfunction -endif - -setlocal iskeyword+=- -setlocal keywordprg=:Sman - -if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) - let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<' -else - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif endif diff --git a/runtime/ftplugin/udevrules.vim b/runtime/ftplugin/udevrules.vim index 6404f6c85e..bde9c5dfa0 100644 --- a/runtime/ftplugin/udevrules.vim +++ b/runtime/ftplugin/udevrules.vim @@ -15,5 +15,21 @@ let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . . '\b'' --hilite-search" man ' . 'udev' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . . '\b', '\') . ''' --hilite-search" man ' . 'udev' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save -- cgit From 5d8ab32f3871b0232972cac1116ac7cba98389e5 Mon Sep 17 00:00:00 2001 From: Maria José Solano Date: Fri, 25 Aug 2023 11:17:36 -0700 Subject: feat(treesitter): add a query editor (#24703) --- runtime/ftplugin/query.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index accf38c199..964c221ad4 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -1,6 +1,6 @@ -- Neovim filetype plugin file -- Language: Tree-sitter query --- Last Change: 2022 Apr 25 +-- Last Change: 2023 Aug 23 if vim.b.did_ftplugin == 1 then return @@ -14,6 +14,8 @@ vim.treesitter.start() -- set omnifunc vim.bo.omnifunc = 'v:lua.vim.treesitter.query.omnifunc' +vim.opt_local.iskeyword:append('.') + -- query linter local buf = vim.api.nvim_get_current_buf() local query_lint_on = vim.g.query_lint_on or { 'BufEnter', 'BufWrite' } -- cgit From 0e3ea0a262329ba21bb10c74ea5d689f0597aabd Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 29 Aug 2023 11:03:04 +0200 Subject: vim-patch:f937ab32a1ac runtime: Set b:undo_ftplugin where missing (vim/vim#12943) https://github.com/vim/vim/commit/f937ab32a1ac3a560f217ca4ce8305ab2d5b0b74 Co-authored-by: dkearns --- runtime/ftplugin/abap.vim | 4 +++ runtime/ftplugin/art.vim | 3 ++ runtime/ftplugin/asm.vim | 6 ++-- runtime/ftplugin/bzl.vim | 5 +++ runtime/ftplugin/dune.vim | 7 ++-- runtime/ftplugin/fish.vim | 3 ++ runtime/ftplugin/hare.vim | 34 ++++++++++++-------- runtime/ftplugin/ishd.vim | 23 ++++++++------ runtime/ftplugin/lprolog.vim | 12 +++++-- runtime/ftplugin/nginx.vim | 3 ++ runtime/ftplugin/pbtxt.vim | 8 ++--- runtime/ftplugin/scala.vim | 3 ++ runtime/ftplugin/sexplib.vim | 3 ++ runtime/ftplugin/usd.vim | 8 ++--- runtime/ftplugin/vhdl.vim | 76 ++++++++++++++++++++++++++++---------------- 15 files changed, 130 insertions(+), 68 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/abap.vim b/runtime/ftplugin/abap.vim index 956b002ecd..61db8093fb 100644 --- a/runtime/ftplugin/abap.vim +++ b/runtime/ftplugin/abap.vim @@ -3,6 +3,7 @@ " Author: Steven Oliver " Copyright: Copyright (c) 2013 Steven Oliver " License: You may redistribute this under the same terms as Vim itself +" Last Change: 2023 Aug 28 by Vim Project (undo_ftplugin) " -------------------------------------------------------------------------- " Only do this when not done yet for this buffer @@ -17,10 +18,13 @@ set cpo&vim setlocal softtabstop=2 shiftwidth=2 setlocal suffixesadd=.abap +let b:undo_ftplugin = "setl sts< sua< sw<" + " Windows allows you to filter the open file dialog if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" . \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/art.vim b/runtime/ftplugin/art.vim index c501a992d8..41b02a94e5 100644 --- a/runtime/ftplugin/art.vim +++ b/runtime/ftplugin/art.vim @@ -3,6 +3,7 @@ " Maintainer: Dorai Sitaram " URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html " Last Change: Apr 2, 2003 +" 2023 Aug 28 by Vim Project (undo_ftplugin) " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -13,3 +14,5 @@ run ftplugin/lisp.vim setl lw-=if setl lw+=def-art-fun,deffacts,defglobal,defrule,defschema,for,schema,while + +let b:undo_ftplugin ..= " | setl lw<" diff --git a/runtime/ftplugin/asm.vim b/runtime/ftplugin/asm.vim index 0914bf634a..f6a92d57d7 100644 --- a/runtime/ftplugin/asm.vim +++ b/runtime/ftplugin/asm.vim @@ -1,11 +1,13 @@ " Vim filetype plugin file " Language: asm " Maintainer: Colin Caine -" Last Changed: 23 May 2020 +" Last Change: 23 May 2020 +" 2023 Aug 28 by Vim Project (undo_ftplugin) if exists("b:did_ftplugin") | finish | endif +let b:did_ftplugin = 1 setl comments=:;,s1:/*,mb:*,ex:*/,:// setl commentstring=;%s -let b:did_ftplugin = 1 +let b:undo_ftplugin = "setl commentstring< comments<" diff --git a/runtime/ftplugin/bzl.vim b/runtime/ftplugin/bzl.vim index 8ab876e9d6..716b3890b1 100644 --- a/runtime/ftplugin/bzl.vim +++ b/runtime/ftplugin/bzl.vim @@ -2,6 +2,7 @@ " Language: Bazel (http://bazel.io) " Maintainer: David Barnett (https://github.com/google/vim-ft-bzl) " Last Change: 2021 Jan 19 +" 2023 Aug 28 by Vim Project (undo_ftplugin) "" " @section Introduction, intro @@ -41,6 +42,9 @@ let &l:tabstop = s:save_tabstop setlocal formatoptions-=t +" Initially defined in the python ftplugin sourced above +let b:undo_ftplugin .= " | setlocal fo<" + " Make gf work with imports in BUILD files. setlocal includeexpr=substitute(v:fname,'//','','') @@ -48,6 +52,7 @@ setlocal includeexpr=substitute(v:fname,'//','','') if get(g:, 'ft_bzl_fold', 0) setlocal foldmethod=syntax setlocal foldtext=BzlFoldText() + let b:undo_ftplugin .= " | setlocal fdm< fdt<" endif if exists('*BzlFoldText') diff --git a/runtime/ftplugin/dune.vim b/runtime/ftplugin/dune.vim index 86c99c097f..6e20a8fabb 100644 --- a/runtime/ftplugin/dune.vim +++ b/runtime/ftplugin/dune.vim @@ -3,8 +3,9 @@ " Anton Kochkov " URL: https://github.com/ocaml/vim-ocaml " Last Change: -" 2018 Nov 3 - Added commentstring (Markus Mottl) -" 2017 Sep 6 - Initial version (Etienne Millon) +" 2023 Aug 28 - Added undo_ftplugin (Vim Project) +" 2018 Nov 03 - Added commentstring (Markus Mottl) +" 2017 Sep 06 - Initial version (Etienne Millon) if exists("b:did_ftplugin") finish @@ -18,3 +19,5 @@ setl commentstring=;\ %s setl comments=:; setl iskeyword+=#,?,.,/ + +let b:undo_ftplugin = "setl lisp< cms< com< isk<" diff --git a/runtime/ftplugin/fish.vim b/runtime/ftplugin/fish.vim index 7acbf44210..f06ad3a0bf 100644 --- a/runtime/ftplugin/fish.vim +++ b/runtime/ftplugin/fish.vim @@ -3,6 +3,7 @@ " Maintainer: Nicholas Boyle (github.com/nickeb96) " Repository: https://github.com/nickeb96/fish.vim " Last Change: February 1, 2023 +" 2023 Aug 28 by Vim Project (undo_ftplugin) if exists("b:did_ftplugin") finish @@ -13,3 +14,5 @@ setlocal iskeyword=@,48-57,_,192-255,-,. setlocal comments=:# setlocal commentstring=#%s setlocal formatoptions+=crjq + +let b:undo_ftplugin = "setl cms< com< fo< isk<" diff --git a/runtime/ftplugin/hare.vim b/runtime/ftplugin/hare.vim index bb10daf38c..0200ba5913 100644 --- a/runtime/ftplugin/hare.vim +++ b/runtime/ftplugin/hare.vim @@ -2,26 +2,34 @@ " Language: Hare " Maintainer: Amelia Clarke " Previous Maintainer: Drew DeVault -" Last Updated: 2022-09-21 +" Last Updated: 2022-09-28 +" 2023 Aug 28 by Vim Project (undo_ftplugin) -" 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 noexpandtab -setlocal tabstop=8 -setlocal shiftwidth=0 -setlocal softtabstop=0 -setlocal textwidth=80 +" Formatting settings. +setlocal formatoptions-=t formatoptions+=croql/ + +" Miscellaneous. +setlocal comments=:// setlocal commentstring=//\ %s +setlocal suffixesadd=.ha -" Set 'formatoptions' to break comment lines but not other lines, -" and insert the comment leader when hitting or using "o". -setlocal fo-=t fo+=croql +let b:undo_ftplugin = "setl cms< com< fo< sua<" + +" Hare recommended style. +if get(g:, "hare_recommended_style", 1) + setlocal noexpandtab + setlocal shiftwidth=8 + setlocal softtabstop=0 + setlocal tabstop=8 + setlocal textwidth=80 + let b:undo_ftplugin ..= " | setl et< sts< sw< ts< tw<" +endif compiler hare -" vim: tabstop=2 shiftwidth=2 expandtab + +" vim: et sw=2 sts=2 ts=8 diff --git a/runtime/ftplugin/ishd.vim b/runtime/ftplugin/ishd.vim index 33ef1510b5..b160349033 100644 --- a/runtime/ftplugin/ishd.vim +++ b/runtime/ftplugin/ishd.vim @@ -1,32 +1,37 @@ " Vim filetype plugin file -" Language: InstallShield (ft=ishd) -" Maintainer: Johannes Zellner -" Last Change: Sat, 24 May 2003 11:55:36 CEST +" Language: InstallShield (ft=ishd) +" Maintainer: Doug Kearns +" Previous Maintainer: Johannes Zellner +" Last Change: 2023 Aug 28 if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 -setlocal foldmethod=syntax - " Using line continuation here. let s:cpo_save = &cpo set cpo-=C +setlocal foldmethod=syntax + +let b:undo_ftplugin = "setl fdm<" + " matchit support if exists("loaded_matchit") - let b:match_ignorecase=0 - let b:match_words= + let b:match_ignorecase = 0 + let b:match_words = \ '\%(^\s*\)\@<=\\s\+[^()]\+\s*(:\%(^\s*\)\@<=\\s*$:\%(^\s*\)\@<=\:\%(^\s*\)\@<=\\s*;\s*$,' . \ '\%(^\s*\)\@<=\\s*$:\%(^\s*\)\@<=\\s\+.\{-}\s*;\s*$,' . \ '\%(^\s*\)\@<=\\s*(.\{-}):\%(^\s*\)\@<=\<\%(case\|default\)\>:\%(^\s*\)\@<=\\s*;\s*$,' . \ '\%(^\s*\)\@<=\\s*(.\{-}):\%(^\s*\)\@<=\\s*;\s*$,' . \ '\%(^\s*\)\@<=\.\{-}\<\%(to\|downto\)\>:\%(^\s*\)\@<=\\s*;\s*$,' . \ '\%(^\s*\)\@<=\\s*(.\{-})\s*then:\%(^\s*\)\@<=\\s*([^)]*)\s*then:\%(^\s*\)\@<=\:\%(^\s*\)\@<=\\s*;\s*$' + let b:undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words" endif -if has("gui_win32") && !exists("b:browsefilter") +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "InstallShield Files (*.rul)\t*.rul\n" . - \ "All Files (*.*)\t*.*\n" + \ "All Files (*.*)\t*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/lprolog.vim b/runtime/ftplugin/lprolog.vim index a8a3c612c1..1075a9c813 100644 --- a/runtime/ftplugin/lprolog.vim +++ b/runtime/ftplugin/lprolog.vim @@ -2,7 +2,8 @@ " Language: LambdaProlog (Teyjus) " Maintainer: Markus Mottl " URL: http://www.ocaml.info/vim/ftplugin/lprolog.vim -" Last Change: 2006 Feb 05 +" Last Change: 2023 Aug 28 - added undo_ftplugin (Vim Project) +" 2006 Feb 05 " 2001 Sep 16 - fixed 'no_mail_maps'-bug (MM) " 2001 Sep 02 - initial release (MM) @@ -15,11 +16,13 @@ endif let b:did_ftplugin = 1 " Error format -setlocal efm=%+A./%f:%l.%c:\ %m formatprg=fmt\ -w75\ -p\\% +setlocal efm=%+A./%f:%l.%c:\ %m " Formatting of comments setlocal formatprg=fmt\ -w75\ -p\\% +let b:undo_ftplugin = "setlocal efm< fp<" + " Add mappings, unless the user didn't want this. if !exists("no_plugin_maps") && !exists("no_lprolog_maps") " Uncommenting @@ -28,6 +31,11 @@ if !exists("no_plugin_maps") && !exists("no_lprolog_maps") vmap c BUncomOn nmap C LUncomOff vmap C BUncomOff + let b:undo_ftplugin ..= + \ " | silent! execute 'nunmap c'" .. + \ " | silent! execute 'vunmap c'" .. + \ " | silent! execute 'nunmap C'" .. + \ " | silent! execute 'vunmap C'" endif nnoremap LUncomOn mz0i/* $A */`z diff --git a/runtime/ftplugin/nginx.vim b/runtime/ftplugin/nginx.vim index e808db1277..525d0fdccf 100644 --- a/runtime/ftplugin/nginx.vim +++ b/runtime/ftplugin/nginx.vim @@ -2,5 +2,8 @@ " Language: nginx.conf " Maintainer: Chris Aumann " Last Change: Apr 15, 2017 +" 2023 Aug 28 by Vim Project (undo_ftplugin) setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setlocal commentstring<" diff --git a/runtime/ftplugin/pbtxt.vim b/runtime/ftplugin/pbtxt.vim index e3c1bf7650..56c2553ca8 100644 --- a/runtime/ftplugin/pbtxt.vim +++ b/runtime/ftplugin/pbtxt.vim @@ -2,20 +2,16 @@ " Language: Protobuf Text Format " Maintainer: Lakshay Garg " Last Change: 2020 Nov 17 +" 2023 Aug 28 by Vim Project (undo_ftplugin) " Homepage: https://github.com/lakshayg/vim-pbtxt if exists("b:did_ftplugin") finish endif - let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim - setlocal commentstring=#\ %s -let &cpo = s:cpo_save -unlet s:cpo_save +let b:undo_ftplugin = "setlocal commentstring<" " vim: nowrap sw=2 sts=2 ts=8 noet diff --git a/runtime/ftplugin/scala.vim b/runtime/ftplugin/scala.vim index b484df99f3..769499cfc1 100644 --- a/runtime/ftplugin/scala.vim +++ b/runtime/ftplugin/scala.vim @@ -4,6 +4,7 @@ " URL: https://github.com/derekwyatt/vim-scala " License: Same as Vim " Last Change: 11 August 2021 +" 2023 Aug 28 by Vim Project (undo_ftplugin) " ---------------------------------------------------------------------------- if exists('b:did_ftplugin') || &cp @@ -32,4 +33,6 @@ setlocal includeexpr=substitute(v:fname,'\\.','/','g') setlocal path+=src/main/scala,src/test/scala setlocal suffixesadd=.scala +let b:undo_ftplugin = "setlocal cms< com< et< fo< inc< inex< pa< sts< sua< sw<" + " vim:set sw=2 sts=2 ts=8 et: diff --git a/runtime/ftplugin/sexplib.vim b/runtime/ftplugin/sexplib.vim index 27e1b28370..b0767ef559 100644 --- a/runtime/ftplugin/sexplib.vim +++ b/runtime/ftplugin/sexplib.vim @@ -3,6 +3,7 @@ " Maintainer: Markus Mottl " URL: https://github.com/ocaml/vim-ocaml " Last Change: +" 2023 Aug 28 - Added undo_ftplugin (Vim Project) " 2017 Apr 12 - First version (MM) if exists("b:did_ftplugin") @@ -13,3 +14,5 @@ let b:did_ftplugin=1 " Comment string setl commentstring=;\ %s setl comments=:; + +let b:undo_ftplugin = "setl cms< com<" diff --git a/runtime/ftplugin/usd.vim b/runtime/ftplugin/usd.vim index c795ba591b..cd5013f960 100644 --- a/runtime/ftplugin/usd.vim +++ b/runtime/ftplugin/usd.vim @@ -2,17 +2,13 @@ " Language: Pixar Animation's Universal Scene Description format " Maintainer: Colin Kennedy " Last Change: 2023 May 9 +" 2023 Aug 28 by Vim Project (undo_ftplugin) if exists("b:did_ftplugin") finish endif - -let s:cpo_save = &cpo -set cpo&vim - let b:did_ftplugin = 1 setlocal commentstring=#\ %s -let &cpo = s:cpo_save -unlet s:cpo_save +let b:undo_ftplugin = "setlocal commentstring<" diff --git a/runtime/ftplugin/vhdl.vim b/runtime/ftplugin/vhdl.vim index 0249b542be..ff56166ebe 100644 --- a/runtime/ftplugin/vhdl.vim +++ b/runtime/ftplugin/vhdl.vim @@ -3,6 +3,7 @@ " Maintainer: R.Shankar " Modified By: Gerald Lai " Last Change: 2011 Dec 11 +" 2023 Aug 28 by Vim Project (undo_ftplugin, commentstring) " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -22,13 +23,20 @@ set cpo&vim " Set 'comments' to format dashed lists in comments. "setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// +setlocal commentstring=--\ %s + " Format comments to be up to 78 characters long "setlocal tw=75 +" let b:undo_ftplugin = "setl cms< com< fo< tw<" + +let b:undo_ftplugin = "setl cms< " + " Win32 can filter files in the browse dialog "if has("gui_win32") && !exists("b:browsefilter") " let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" . " \ "All Files (*.*)\t*.*\n" +" let b:undo_ftplugin .= " | unlet! b:browsefilter" "endif " Let the matchit plugin know what items can be matched. @@ -52,37 +60,49 @@ if ! exists("b:match_words") && exists("loaded_matchit") \ s:notend.'\:\,'. \ s:notend.'\:\,'. \ s:notend.'\:\' + let b:undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words" endif -" count repeat -function! CountWrapper(cmd) - let i = v:count1 - if a:cmd[0] == ":" - while i > 0 - execute a:cmd - let i = i - 1 - endwhile - else - execute "normal! gv\" - execute "normal ".i.a:cmd - let curcol = col(".") - let curline = line(".") - normal! gv - call cursor(curline, curcol) - endif -endfunction +if !exists("no_plugin_maps") && !exists("no_vhdl_maps") + " count repeat + function! CountWrapper(cmd) + let i = v:count1 + if a:cmd[0] == ":" + while i > 0 + execute a:cmd + let i = i - 1 + endwhile + else + execute "normal! gv\" + execute "normal ".i.a:cmd + let curcol = col(".") + let curline = line(".") + normal! gv + call cursor(curline, curcol) + endif + endfunction -" explore motion -" keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units" -let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)' -noremap [[ :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%^","bW")') -noremap ]] :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%$","W")') -noremap [] :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%^","bW")') -noremap ][ :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%$","W")') -vnoremap [[ :cal CountWrapper('[[') -vnoremap ]] :cal CountWrapper(']]') -vnoremap [] :cal CountWrapper('[]') -vnoremap ][ :cal CountWrapper('][') + " explore motion + " keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units" + let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)' + noremap [[ :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%^","bW")') + noremap ]] :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%$","W")') + noremap [] :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%^","bW")') + noremap ][ :cal CountWrapper(':cal search("\\%(--.*\\)\\@\\c\\\\%$","W")') + vnoremap [[ :cal CountWrapper('[[') + vnoremap ]] :cal CountWrapper(']]') + vnoremap [] :cal CountWrapper('[]') + vnoremap ][ :cal CountWrapper('][') + let b:undo_ftplugin .= + \ " | silent! execute 'nunmap [['" . + \ " | silent! execute 'nunmap ]]'" . + \ " | silent! execute 'nunmap []'" . + \ " | silent! execute 'nunmap ]['" . + \ " | silent! execute 'vunmap [['" . + \ " | silent! execute 'vunmap ]]'" . + \ " | silent! execute 'vunmap []'" . + \ " | silent! execute 'vunmap ]['" +endif let &cpo = s:cpo_save unlet s:cpo_save -- cgit From 88bf4204ef33a842f2cbdc66590dadda8bf4e1ef Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 29 Aug 2023 22:19:06 +0200 Subject: vim-patch:3ac2d3da5fdf runtime(heex): Add HEEX comments to match_words in ftplugin (vim/vim#12957) https://github.com/vim/vim/commit/3ac2d3da5fdf20dfddb450a49502ef47b1f581d4 Co-authored-by: Jason King --- runtime/ftplugin/heex.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/heex.vim b/runtime/ftplugin/heex.vim index f79c69d2aa..becc071c37 100644 --- a/runtime/ftplugin/heex.vim +++ b/runtime/ftplugin/heex.vim @@ -18,7 +18,7 @@ let b:undo_ftplugin = 'set sw< sts< et< com< cms<' " HTML: thanks to Johannes Zellner and Benji Fisher. if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 1 - let b:match_words = ',' .. + let b:match_words = '<%\{-}!--:--%\{-}>,' .. \ '<:>,' .. \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .. \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .. -- cgit From 3fcd6da5b0bf6016be24b2574cfe3cdf1071237b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 30 Aug 2023 09:25:39 +0200 Subject: vim-patch:2ac708b54866 runtime(sh): Update ftplugin (vim/vim#12950) Remove :Help command via the undo_ftplugin mechanism. https://github.com/vim/vim/commit/2ac708b548660b232a32c52d89bde3d8596646c0 Co-authored-by: dkearns --- runtime/ftplugin/sh.vim | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim index 7106bf9155..4409f3f90c 100644 --- a/runtime/ftplugin/sh.vim +++ b/runtime/ftplugin/sh.vim @@ -2,15 +2,14 @@ " Language: sh " Maintainer: Doug Kearns " Previous Maintainer: Dan Sharp -" Last Change: 2022 Sep 07 +" Contributor: Enno Nagel +" Last Change: 2023 Aug 29 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 -" Make sure the continuation lines below do not cause problems in -" compatibility mode. let s:save_cpo = &cpo set cpo-=C @@ -32,18 +31,17 @@ if exists("loaded_matchit") && !exists("b:match_words") 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") || 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: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 -if (exists('b:is_bash') && (b:is_bash == 1)) || - \ (exists('b:is_sh') && (b:is_sh == 1)) - if !has('gui_running') && executable('less') +if (exists("b:is_bash") && (b:is_bash == 1)) || + \ (exists("b:is_sh") && (b:is_sh == 1)) + if !has("gui_running") && executable("less") command! -buffer -nargs=1 Help silent exe '!bash -c "{ help "" 2>/dev/null || man ""; } | LESS= less"' | redraw! elseif has('terminal') command! -buffer -nargs=1 Help silent exe ':term bash -c "help "" 2>/dev/null || man """' @@ -51,10 +49,9 @@ if (exists('b:is_bash') && (b:is_bash == 1)) || command! -buffer -nargs=1 Help echo system('bash -c "help " 2>/dev/null || man ""') endif setlocal keywordprg=:Help - let b:undo_ftplugin .= '| setlocal keywordprg<' + let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer Help" endif -" Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo -- cgit From b2c3e9c72ef12a5bc276dec78cdc8dfbd2f5a24b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 30 Aug 2023 18:16:30 +0200 Subject: vim-patch:9d8ef7cc4340 runtime: cleanup :Sman command via the undo_ftplugin mechanism (vim/vim#12967) Regards to @dkearns as noticed in https://github.com/vim/vim/commit/2ac708b548660b232a32c52d89bde3d8596646c0 https://github.com/vim/vim/commit/9d8ef7cc434076dfda62ca3d3101eaae52e316cd Co-authored-by: Enno --- runtime/ftplugin/gpg.vim | 2 +- runtime/ftplugin/modconf.vim | 2 +- runtime/ftplugin/muttrc.vim | 2 +- runtime/ftplugin/readline.vim | 2 +- runtime/ftplugin/sshconfig.vim | 2 +- runtime/ftplugin/sudoers.vim | 2 +- runtime/ftplugin/systemd.vim | 2 +- runtime/ftplugin/udevrules.vim | 2 +- runtime/ftplugin/zsh.vim | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/gpg.vim b/runtime/ftplugin/gpg.vim index 9e00daed6a..2415555e09 100644 --- a/runtime/ftplugin/gpg.vim +++ b/runtime/ftplugin/gpg.vim @@ -27,7 +27,7 @@ if has('unix') && executable('less') if exists(':Sman') == 2 setlocal iskeyword+=- setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' endif endif diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim index 09ad54b64a..d5eda5af21 100644 --- a/runtime/ftplugin/modconf.vim +++ b/runtime/ftplugin/modconf.vim @@ -28,7 +28,7 @@ if has('unix') && executable('less') if exists(':Sman') == 2 setlocal iskeyword+=- setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' endif endif diff --git a/runtime/ftplugin/muttrc.vim b/runtime/ftplugin/muttrc.vim index bd01367158..7a4eb7a8bb 100644 --- a/runtime/ftplugin/muttrc.vim +++ b/runtime/ftplugin/muttrc.vim @@ -30,7 +30,7 @@ if has('unix') && executable('less') if exists(':Sman') == 2 setlocal iskeyword+=- setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' endif endif diff --git a/runtime/ftplugin/readline.vim b/runtime/ftplugin/readline.vim index c81d0f2f65..a696da2701 100644 --- a/runtime/ftplugin/readline.vim +++ b/runtime/ftplugin/readline.vim @@ -42,7 +42,7 @@ if has('unix') && executable('less') if exists(':Sman') == 2 setlocal iskeyword+=- setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' endif endif diff --git a/runtime/ftplugin/sshconfig.vim b/runtime/ftplugin/sshconfig.vim index 214e4928a0..c9a5cfaa68 100644 --- a/runtime/ftplugin/sshconfig.vim +++ b/runtime/ftplugin/sshconfig.vim @@ -26,7 +26,7 @@ if has('unix') && executable('less') if exists(':Sman') == 2 setlocal iskeyword+=- setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' endif endif diff --git a/runtime/ftplugin/sudoers.vim b/runtime/ftplugin/sudoers.vim index 65cf2d8203..b4123620af 100644 --- a/runtime/ftplugin/sudoers.vim +++ b/runtime/ftplugin/sudoers.vim @@ -27,7 +27,7 @@ if has('unix') && executable('less') if exists(':Sman') == 2 setlocal iskeyword+=- setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' endif endif diff --git a/runtime/ftplugin/systemd.vim b/runtime/ftplugin/systemd.vim index c0bc6302f2..e60a5e4960 100644 --- a/runtime/ftplugin/systemd.vim +++ b/runtime/ftplugin/systemd.vim @@ -30,7 +30,7 @@ if has('unix') && executable('less') if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<' else - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' endif endif endif diff --git a/runtime/ftplugin/udevrules.vim b/runtime/ftplugin/udevrules.vim index bde9c5dfa0..83fb728a54 100644 --- a/runtime/ftplugin/udevrules.vim +++ b/runtime/ftplugin/udevrules.vim @@ -27,7 +27,7 @@ if has('unix') && executable('less') if exists(':Sman') == 2 setlocal iskeyword+=- setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' endif endif diff --git a/runtime/ftplugin/zsh.vim b/runtime/ftplugin/zsh.vim index 0ca8077305..ed75d04003 100644 --- a/runtime/ftplugin/zsh.vim +++ b/runtime/ftplugin/zsh.vim @@ -30,7 +30,7 @@ if executable('zsh') && &shell !~# '/\%(nologin\|false\)$' compiler zsh endif setlocal keywordprg=:RunHelp - let b:undo_ftplugin .= 'keywordprg<' + let b:undo_ftplugin .= 'keywordprg< | sil! delc -buffer RunHelp' endif let b:match_words = '\:\:\:\' -- cgit From 2fad4c0b392bb9d7fbb742be1fd5d214683b8ebb Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 31 Aug 2023 08:21:25 +0200 Subject: vim-patch:1610528cc305 runtime(forth): Update syntax and ftplugin files (vim/vim#12976) https://github.com/vim/vim/commit/1610528cc3052103e368c4175b09db6f9a6c150c Co-authored-by: dkearns --- runtime/ftplugin/forth.vim | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 runtime/ftplugin/forth.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/forth.vim b/runtime/ftplugin/forth.vim new file mode 100644 index 0000000000..5343784a21 --- /dev/null +++ b/runtime/ftplugin/forth.vim @@ -0,0 +1,71 @@ +" Vim filetype plugin +" Language: Forth +" Maintainer: Johan Kotlinski +" Last Change: 2023 Aug 08 +" URL: https://github.com/jkotlinski/forth.vim + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal commentstring=\\\ %s +setlocal comments=s:(,mb:\ ,e:),b:\\ +setlocal iskeyword=33-126,128-255 + +let s:include_patterns =<< trim EOL + + \<\%(INCLUDE\|REQUIRE\)\>\s\+\zs\k\+\ze + \ +EOL +let &l:include = $'\c{ s:include_patterns[1:]->join('\|') }' + +let s:define_patterns =<< trim EOL + : + [2F]\=CONSTANT + [2F]\=VALUE + [2F]\=VARIABLE + BEGIN-STRUCTURE + BUFFER: + CODE + CREATE + MARKER + SYNONYM +EOL +let &l:define = $'\c\<\%({ s:define_patterns->join('\|') }\)' + +" assume consistent intra-project file extensions +let &l:suffixesadd = "." .. expand("%:e") + +let b:undo_ftplugin = "setl cms< com< def< inc< isk< sua<" + +if exists("loaded_matchit") && !exists("b:match_words") + let s:matchit_patterns =<< trim EOL + + \<\:\%(NONAME\)\=\>:\:\<;\> + \:\:\ + \<\[IF]\>:\<\[ELSE]\>:\<\[THEN]\> + \:\:\<+\=LOOP\> + \:\ + \:\ + \:\:\<\%(AGAIN\|REPEAT\|UNTIL\)\> + \:\ + \:\ + EOL + let b:match_ignorecase = 1 + let b:match_words = s:matchit_patterns[1:]->join(',') + let b:undo_ftplugin ..= "| unlet! b:match_ignorecase b:match_words" +endif + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Forth Source Files (*.f *.fs *.ft *.fth *.4th)\t*.f;*.fs;*.ft;*.fth;*.4th\n" .. + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save +unlet s:define_patterns s:include_patterns s:matchit_patterns -- cgit From 7bf0963d48ec76b1cdeee55edc8f2053eca87367 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 1 Sep 2023 11:38:31 +0800 Subject: vim-patch:9.0.1833: [security] runtime file fixes (#24969) Problem: runtime files may execute code in current dir Solution: only execute, if not run from current directory The perl, zig and ruby filetype plugins and the zip and gzip autoload plugins may try to load malicious executable files from the current working directory. This is especially a problem on windows, where the current directory is implicitly in your $PATH and windows may even run a file with the extension `.bat` because of $PATHEXT. So make sure that we are not trying to execute a file from the current directory. If this would be the case, error out (for the zip and gzip) plugins or silently do not run those commands (for the ftplugins). This assumes, that only the current working directory is bad. For all other directories, it is assumed that those directories were intentionally set to the $PATH by the user. https://github.com/vim/vim/commit/816fbcc262687b81fc46f82f7bbeb1453addfe0c Co-authored-by: Christian Brabandt --- runtime/ftplugin/perl.vim | 3 ++- runtime/ftplugin/ruby.vim | 68 +++++++++++++++++++++++++++-------------------- runtime/ftplugin/zig.vim | 4 ++- 3 files changed, 44 insertions(+), 31 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim index d0bdbc0cfb..edc7b960f1 100644 --- a/runtime/ftplugin/perl.vim +++ b/runtime/ftplugin/perl.vim @@ -54,7 +54,8 @@ endif " Set this once, globally. if !exists("perlpath") - if executable("perl") + " safety check: don't execute perl from current directory + if executable("perl") && fnamemodify(exepath("perl"), ":p:h") != getcwd() try if &shellxquote != '"' let perlpath = system('perl -e "print join(q/,/,@INC)"') diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index 8c1f47731c..f4e1f60438 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -99,41 +99,51 @@ function! s:build_path(path) abort return path endfunction -if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h')) - let s:version_file = findfile('.ruby-version', '.;') - if !empty(s:version_file) && filereadable(s:version_file) - let b:ruby_version = get(readfile(s:version_file, '', 1), '') - if !has_key(g:ruby_version_paths, b:ruby_version) - let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h')) +let s:execute_ruby = 1 +" Security Check, don't execute ruby from the current directory +if fnamemodify(exepath("ruby"), ":p:h") ==# getcwd() + let s:execute_ruby = 0 +endif + +function SetRubyPath() + if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h')) + let s:version_file = findfile('.ruby-version', '.;') + if !empty(s:version_file) && filereadable(s:version_file) && s:execute_ruby + let b:ruby_version = get(readfile(s:version_file, '', 1), '') + if !has_key(g:ruby_version_paths, b:ruby_version) + let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h')) + endif endif endif -endif -if exists("g:ruby_path") - let s:ruby_path = type(g:ruby_path) == type([]) ? join(g:ruby_path, ',') : g:ruby_path -elseif has_key(g:ruby_version_paths, get(b:, 'ruby_version', '')) - let s:ruby_paths = g:ruby_version_paths[b:ruby_version] - let s:ruby_path = s:build_path(s:ruby_paths) -else - if !exists('g:ruby_default_path') - if has("ruby") && has("win32") - ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) ) - elseif executable('ruby') && !empty($HOME) - let g:ruby_default_path = s:query_path($HOME) - else - let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val') + if exists("g:ruby_path") + let s:ruby_path = type(g:ruby_path) == type([]) ? join(g:ruby_path, ',') : g:ruby_path + elseif has_key(g:ruby_version_paths, get(b:, 'ruby_version', '')) && s:execute_ruby + let s:ruby_paths = g:ruby_version_paths[b:ruby_version] + let s:ruby_path = s:build_path(s:ruby_paths) + else + if !exists('g:ruby_default_path') + if has("ruby") && has("win32") + ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) ) + elseif executable('ruby') && !empty($HOME) && s:execute_ruby + let g:ruby_default_path = s:query_path($HOME) + else + let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val') + endif endif + let s:ruby_paths = g:ruby_default_path + let s:ruby_path = s:build_path(s:ruby_paths) endif - let s:ruby_paths = g:ruby_default_path - let s:ruby_path = s:build_path(s:ruby_paths) -endif -if stridx(&l:path, s:ruby_path) == -1 - let &l:path = s:ruby_path -endif -if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val."/tags"'),',')) == -1 - let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',') -endif + if stridx(&l:path, s:ruby_path) == -1 + let &l:path = s:ruby_path + endif + if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val."/tags"'),',')) == -1 + let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',') + endif +endfunction + +call SetRubyPath() if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" . diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim index 5f453fc8d1..cd18bfe2bd 100644 --- a/runtime/ftplugin/zig.vim +++ b/runtime/ftplugin/zig.vim @@ -39,7 +39,9 @@ endif let &l:define='\v(|||^\s*\#\s*define)' -if !exists('g:zig_std_dir') && exists('*json_decode') && executable('zig') +" Safety check: don't execute zip from current directory +if !exists('g:zig_std_dir') && exists('*json_decode') && + \ executable('zig') && fnamemodify(exepath("zig"), ":p:h") != getcwd() silent let s:env = system('zig env') if v:shell_error == 0 let g:zig_std_dir = json_decode(s:env)['std_dir'] -- cgit From 61ccdb2db62481a38604426be530753ad2f9e7cb Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 2 Sep 2023 10:43:23 +0200 Subject: vim-patch:da16a1b471aa runtime(ruby): Update syntax, indent and ftplugin files While making changes to the ruby ftplugin, slightly change the exepath() conditional from patch 9.0.1833 and move it after the :cd invocation. closes: 12981 closes: 12994 https://github.com/vim/vim/commit/da16a1b471aa717f58909cc6531cb6dbbff14d22 Co-authored-by: Doug Kearns Co-authored-by: Tim Pope --- runtime/ftplugin/eruby.vim | 12 +++++--- runtime/ftplugin/ruby.vim | 76 +++++++++++++++++++++------------------------- 2 files changed, 43 insertions(+), 45 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/eruby.vim b/runtime/ftplugin/eruby.vim index e67b00b278..893fa58d32 100644 --- a/runtime/ftplugin/eruby.vim +++ b/runtime/ftplugin/eruby.vim @@ -3,7 +3,7 @@ " Maintainer: Tim Pope " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns -" Last Change: 2020 Jun 28 +" Last Change: 2022 May 15 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -86,8 +86,12 @@ runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim let b:did_ftplugin = 1 " Combine the new set of values with those previously included. -if exists("b:undo_ftplugin") - let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin +if !exists('b:undo_ftplugin') + " No-op + let b:undo_ftplugin = 'exe' +endif +if !empty(s:undo_ftplugin) + let b:undo_ftplugin .= '|' . s:undo_ftplugin endif if exists ("b:browsefilter") let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter @@ -119,7 +123,7 @@ endif setlocal commentstring=<%#%s%> let b:undo_ftplugin = "setl cms< " . - \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin + \ " | unlet! b:browsefilter b:match_words | " . b:undo_ftplugin let &cpo = s:save_cpo unlet s:save_cpo diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index f4e1f60438..1262099d88 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -3,7 +3,7 @@ " Maintainer: Tim Pope " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns -" Last Change: 2022 Mar 21 +" Last Change: 2023 Sep 1st if (exists("b:did_ftplugin")) finish @@ -77,7 +77,11 @@ function! s:query_path(root) abort let cwd = fnameescape(getcwd()) try exe cd fnameescape(a:root) - let path = split(system(path_check),',') + if fnamemodify(exepath('ruby'), ':p:h') ==# getcwd() + let path = [] + else + let path = split(system(path_check),',') + endif exe cd cwd return path finally @@ -99,51 +103,41 @@ function! s:build_path(path) abort return path endfunction -let s:execute_ruby = 1 -" Security Check, don't execute ruby from the current directory -if fnamemodify(exepath("ruby"), ":p:h") ==# getcwd() - let s:execute_ruby = 0 -endif - -function SetRubyPath() - if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h')) - let s:version_file = findfile('.ruby-version', '.;') - if !empty(s:version_file) && filereadable(s:version_file) && s:execute_ruby - let b:ruby_version = get(readfile(s:version_file, '', 1), '') - if !has_key(g:ruby_version_paths, b:ruby_version) - let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h')) - endif +if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h')) + let s:version_file = findfile('.ruby-version', '.;') + if !empty(s:version_file) && filereadable(s:version_file) + let b:ruby_version = get(readfile(s:version_file, '', 1), '') + if !has_key(g:ruby_version_paths, b:ruby_version) + let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h')) endif endif +endif - if exists("g:ruby_path") - let s:ruby_path = type(g:ruby_path) == type([]) ? join(g:ruby_path, ',') : g:ruby_path - elseif has_key(g:ruby_version_paths, get(b:, 'ruby_version', '')) && s:execute_ruby - let s:ruby_paths = g:ruby_version_paths[b:ruby_version] - let s:ruby_path = s:build_path(s:ruby_paths) - else - if !exists('g:ruby_default_path') - if has("ruby") && has("win32") - ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) ) - elseif executable('ruby') && !empty($HOME) && s:execute_ruby - let g:ruby_default_path = s:query_path($HOME) - else - let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val') - endif +if exists("g:ruby_path") + let s:ruby_path = type(g:ruby_path) == type([]) ? join(g:ruby_path, ',') : g:ruby_path +elseif has_key(g:ruby_version_paths, get(b:, 'ruby_version', '')) + let s:ruby_paths = g:ruby_version_paths[b:ruby_version] + let s:ruby_path = s:build_path(s:ruby_paths) +else + if !exists('g:ruby_default_path') + if has("ruby") && has("win32") + ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) ) + elseif executable('ruby') && !empty($HOME) + let g:ruby_default_path = s:query_path($HOME) + else + let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val') endif - let s:ruby_paths = g:ruby_default_path - let s:ruby_path = s:build_path(s:ruby_paths) - endif - - if stridx(&l:path, s:ruby_path) == -1 - let &l:path = s:ruby_path - endif - if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val."/tags"'),',')) == -1 - let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',') endif -endfunction + let s:ruby_paths = g:ruby_default_path + let s:ruby_path = s:build_path(s:ruby_paths) +endif -call SetRubyPath() +if stridx(&l:path, s:ruby_path) == -1 + let &l:path = s:ruby_path +endif +if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val."/tags"'),',')) == -1 + let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',') +endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" . -- cgit From 6abc608445745e7e8def2aabf57c7a0c26b8a485 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 5 Sep 2023 08:20:56 +0200 Subject: vim-patch:282a94be990f runtime: Fix problem of checking wrong cwd for ruby ftplugin (vim/vim#13026) https://github.com/vim/vim/commit/282a94be990fc1ee5be46548bf7241b583d48972 Co-authored-by: Anton Sharonov (ant0sha) <109120102+ant0sha@users.noreply.github.com> Co-authored-by: Anton Sharonov --- runtime/ftplugin/ruby.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index 1262099d88..daffe1e0dc 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -77,7 +77,7 @@ function! s:query_path(root) abort let cwd = fnameescape(getcwd()) try exe cd fnameescape(a:root) - if fnamemodify(exepath('ruby'), ':p:h') ==# getcwd() + if fnamemodify(exepath('ruby'), ':p:h') ==# cwd let path = [] else let path = split(system(path_check),',') -- cgit From 5d1c1da3c90adece96f491e7f12fd76c03a881c9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 6 Sep 2023 23:49:58 +0200 Subject: vim-patch:67c951df4c95 runtime(ftplugin): allow to exec if curdir is in PATH In case the current directory is present as valid $PATH entry, it is OK to call the program from it, even if vim curdir is in that same directory. (Without that patch, for instance, you will not be able to open .zip files while your current directory is /bin) closes: vim/vim#13027 https://github.com/vim/vim/commit/67c951df4c95981c716eeedb1b102d9668549e65 Co-authored-by: Anton Sharonov --- runtime/ftplugin/perl.vim | 5 ++++- runtime/ftplugin/ruby.vim | 5 ++++- runtime/ftplugin/zig.vim | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim index edc7b960f1..4361097f32 100644 --- a/runtime/ftplugin/perl.vim +++ b/runtime/ftplugin/perl.vim @@ -55,7 +55,9 @@ endif " Set this once, globally. if !exists("perlpath") " safety check: don't execute perl from current directory - if executable("perl") && fnamemodify(exepath("perl"), ":p:h") != getcwd() + let s:tmp_cwd = getcwd() + if executable("perl") && (fnamemodify(exepath("perl"), ":p:h") != s:tmp_cwd + \ || (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) != -1 && s:tmp_cwd != '.')) try if &shellxquote != '"' let perlpath = system('perl -e "print join(q/,/,@INC)"') @@ -71,6 +73,7 @@ if !exists("perlpath") " current directory and the directory of the current file. let perlpath = ".,," endif + unlet s:tmp_cwd endif " Append perlpath to the existing path value, if it is set. Since we don't diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index daffe1e0dc..a424801cd1 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -77,11 +77,14 @@ function! s:query_path(root) abort let cwd = fnameescape(getcwd()) try exe cd fnameescape(a:root) - if fnamemodify(exepath('ruby'), ':p:h') ==# cwd + let s:tmp_cwd = getcwd() + if (fnamemodify(exepath('ruby'), ':p:h') ==# cwd + \ && (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) == -1 || s:tmp_cwd == '.')) let path = [] else let path = split(system(path_check),',') endif + unlet s:tmp_cwd exe cd cwd return path finally diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim index cd18bfe2bd..45ea582615 100644 --- a/runtime/ftplugin/zig.vim +++ b/runtime/ftplugin/zig.vim @@ -40,14 +40,17 @@ endif let &l:define='\v(|||^\s*\#\s*define)' " Safety check: don't execute zip from current directory +let s:tmp_cwd = getcwd() if !exists('g:zig_std_dir') && exists('*json_decode') && - \ executable('zig') && fnamemodify(exepath("zig"), ":p:h") != getcwd() + \ executable('zig') && (fnamemodify(exepath("zig"), ":p:h") != s:tmp_cwd + \ || (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) != -1 && s:tmp_cwd != '.')) silent let s:env = system('zig env') if v:shell_error == 0 let g:zig_std_dir = json_decode(s:env)['std_dir'] endif unlet! s:env endif +unlet s:tmp_cwd if exists('g:zig_std_dir') let &l:path = &l:path . ',' . g:zig_std_dir -- cgit From ec753cf40db4d326c2fbbf5e5be0d249be561a41 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 6 Sep 2023 23:50:17 +0200 Subject: vim-patch:f7ac0ef50988 runtime: don't execute external commands when loading ftplugins This is a followup to 816fbcc262687b81fc46f82f7bbeb1453addfe0c (patch 9.0.1833: [security] runtime file fixes) It basically disables that external commands are run on loading of the filetype plugin, **unless** the user has set the `g:plugin_exec = 1` global variable in their configuration or for a specific filetype the variable g:_exec=1. There are a few more plugins, that may execute system commands like debchangelog, gitcommit, sh, racket, zsh, ps1 but those do at least do not run those commands by default during loading of the filetype plugin (there the command is mostly run as convenience for auto-completion or to provide documentation lookup). closes: vim/vim#13034 https://github.com/vim/vim/commit/f7ac0ef5098856bedca26e7073594a407c05636f Co-authored-by: Christian Brabandt Co-authored-by: Tim Pope --- runtime/ftplugin/awk.vim | 11 +++++++---- runtime/ftplugin/changelog.vim | 12 +++++++++--- runtime/ftplugin/perl.vim | 10 ++++++---- runtime/ftplugin/ruby.vim | 6 +++++- runtime/ftplugin/zig.vim | 8 ++++---- 5 files changed, 31 insertions(+), 16 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/awk.vim b/runtime/ftplugin/awk.vim index 1bca3ad3cf..785088ff9b 100644 --- a/runtime/ftplugin/awk.vim +++ b/runtime/ftplugin/awk.vim @@ -37,11 +37,14 @@ if exists("g:awk_is_gawk") 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') + " Disabled by default for security reasons. + if get(g:, 'awk_exec', get(g:, 'plugin_exec', 0)) + 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 &l:path = path + endif let b:undo_ftplugin .= " | setl inc< path<" endif diff --git a/runtime/ftplugin/changelog.vim b/runtime/ftplugin/changelog.vim index e9df63f8c9..a62433378a 100644 --- a/runtime/ftplugin/changelog.vim +++ b/runtime/ftplugin/changelog.vim @@ -55,13 +55,19 @@ if &filetype == 'changelog' elseif $EMAIL_ADDRESS != "" return $EMAIL_ADDRESS endif + let s:default_login = 'unknown' - let login = s:login() + " Disabled by default for security reasons. + if get(g:, 'changelog_exec', get(g:, 'plugin_exec', 0)) + let login = s:login() + else + let login = s:default_login + endif return printf('%s <%s@%s>', s:name(login), login, s:hostname()) endfunction function! s:login() - return s:trimmed_system_with_default('whoami', 'unknown') + return s:trimmed_system_with_default('whoami', s:default_login) endfunction function! s:trimmed_system_with_default(command, default) @@ -71,7 +77,7 @@ if &filetype == 'changelog' function! s:system_with_default(command, default) let output = system(a:command) if v:shell_error - return default + return a:default endif return output endfunction diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim index 4361097f32..f3de81debe 100644 --- a/runtime/ftplugin/perl.vim +++ b/runtime/ftplugin/perl.vim @@ -54,10 +54,12 @@ endif " Set this once, globally. if !exists("perlpath") - " safety check: don't execute perl from current directory let s:tmp_cwd = getcwd() - if executable("perl") && (fnamemodify(exepath("perl"), ":p:h") != s:tmp_cwd - \ || (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) != -1 && s:tmp_cwd != '.')) + " safety check: don't execute perl binary by default + if executable("perl") && get(g:, 'perl_exec', get(g:, 'plugin_exec', 0)) + \ && (fnamemodify(exepath("perl"), ":p:h") != s:tmp_cwd + \ || (index(split($PATH, has("win32") ? ';' : ':'), s:tmp_cwd) != -1 + \ && s:tmp_cwd != '.')) try if &shellxquote != '"' let perlpath = system('perl -e "print join(q/,/,@INC)"') @@ -73,7 +75,7 @@ if !exists("perlpath") " current directory and the directory of the current file. let perlpath = ".,," endif - unlet s:tmp_cwd + unlet! s:tmp_cwd endif " Append perlpath to the existing path value, if it is set. Since we don't diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index a424801cd1..b61c1765d9 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -61,6 +61,10 @@ if !exists('g:ruby_version_paths') endif function! s:query_path(root) abort + " Disabled by default for security reasons. + if !get(g:, 'ruby_exec', get(g:, 'plugin_exec', 0)) + return [] + endif let code = "print $:.join %q{,}" if &shell =~# 'sh' && empty(&shellxquote) let prefix = 'env PATH='.shellescape($PATH).' ' @@ -84,7 +88,7 @@ function! s:query_path(root) abort else let path = split(system(path_check),',') endif - unlet s:tmp_cwd + unlet! s:tmp_cwd exe cd cwd return path finally diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim index 45ea582615..2a081980cc 100644 --- a/runtime/ftplugin/zig.vim +++ b/runtime/ftplugin/zig.vim @@ -40,17 +40,17 @@ endif let &l:define='\v(|||^\s*\#\s*define)' " Safety check: don't execute zip from current directory -let s:tmp_cwd = getcwd() if !exists('g:zig_std_dir') && exists('*json_decode') && - \ executable('zig') && (fnamemodify(exepath("zig"), ":p:h") != s:tmp_cwd - \ || (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) != -1 && s:tmp_cwd != '.')) + \ executable('zig') && get(g:, 'zig_exec', get(g:, 'plugin_exec', 0)) + \ && (fnamemodify(exepath("zig"), ":p:h") != s:tmp_cwd + \ || (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) != -1 && s:tmp_cwd != '.')) silent let s:env = system('zig env') if v:shell_error == 0 let g:zig_std_dir = json_decode(s:env)['std_dir'] endif unlet! s:env endif -unlet s:tmp_cwd +unlet! s:tmp_cwd if exists('g:zig_std_dir') let &l:path = &l:path . ',' . g:zig_std_dir -- cgit From d0d4160dd13fad952338b8582e2db8838172bbf1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 8 Sep 2023 21:05:35 +0800 Subject: feat(runtime): highlight hl groups in syntax.txt (#25050) - Add runtime/lua/vim/vimhelp.lua, which is a translation of Vim's runtime/import/dist/vimhelp.vim. - Unlike Vim, run the highlighting from an ftplugin file instead of a syntax file, so that it is run even if using treesitter. --- runtime/ftplugin/help.lua | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 runtime/ftplugin/help.lua (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua new file mode 100644 index 0000000000..4cc3386167 --- /dev/null +++ b/runtime/ftplugin/help.lua @@ -0,0 +1,3 @@ +if vim.endswith(vim.fs.normalize(vim.api.nvim_buf_get_name(0)), '/doc/syntax.txt') then + require('vim.vimhelp').highlight_groups() +end -- cgit From 0bee75818e79a4a619c0248e17e98e985187732c Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 8 Sep 2023 23:34:43 +0200 Subject: vim-patch:4e554d282c50 runtime(perl): Update ftplugin and indent files (vim/vim#13052) https://github.com/vim/vim/commit/4e554d282c50e428932df5fff9917f8a836f7782 Co-authored-by: dkearns --- runtime/ftplugin/perl.vim | 2 ++ runtime/ftplugin/pod.vim | 37 ++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 19 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim index f3de81debe..7ea0ae980a 100644 --- a/runtime/ftplugin/perl.vim +++ b/runtime/ftplugin/perl.vim @@ -5,6 +5,8 @@ " Bugs/requests: https://github.com/vim-perl/vim-perl/issues " License: Vim License (see :help license) " Last Change: 2021 Nov 10 +" 2023 Sep 07 by Vim Project (safety check: don't execute perl +" from current directory) if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 diff --git a/runtime/ftplugin/pod.vim b/runtime/ftplugin/pod.vim index 2a905ab354..61a4aa094a 100644 --- a/runtime/ftplugin/pod.vim +++ b/runtime/ftplugin/pod.vim @@ -5,11 +5,12 @@ " Homepage: https://github.com/vim-perl/vim-perl " Bugs/requests: https://github.com/vim-perl/vim-perl/issues " License: Vim License (see :help license) -" Last Change: 2021 Oct 19 +" Last Change: 2023 Jul 05 if exists("b:did_ftplugin") - finish + finish endif +let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo-=C @@ -37,12 +38,12 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:undo_ftplugin .= " | unlet! b:browsefilter" endif -function! s:jumpToSection(backwards) - let flags = a:backwards ? 'bsWz' : 'sWz' - if has('syntax_items') +function s:jumpToSection(direction) + let flags = a:direction == "backward" ? "bsWz" : "sWz" + if has("syntax_items") let skip = "synIDattr(synID(line('.'), col('.'), 1), 'name') !~# '\\'" else - let skip = '' + let skip = "" endif for i in range(v:count1) call search('^=\a', flags, 0, 0, skip) @@ -50,19 +51,17 @@ function! s:jumpToSection(backwards) endfunction if !exists("no_plugin_maps") && !exists("no_pod_maps") - nnoremap ]] call jumpToSection() - vnoremap ]] call jumpToSection() - nnoremap ][ call jumpToSection() - vnoremap ][ call jumpToSection() - nnoremap [[ call jumpToSection(1) - vnoremap [[ call jumpToSection(1) - nnoremap [] call jumpToSection(1) - vnoremap [] call jumpToSection(1) - let b:undo_ftplugin .= - \ " | silent! exe 'nunmap ]]' | silent! exe 'vunmap ]]'" . - \ " | silent! exe 'nunmap ][' | silent! exe 'vunmap ]['" . - \ " | silent! exe 'nunmap ]]' | silent! exe 'vunmap ]]'" . - \ " | silent! exe 'nunmap []' | silent! exe 'vunmap []'" + for s:mode in ["n", "o", "x"] + for s:lhs in ["]]", "]["] + execute s:mode . "noremap " . s:lhs . " call jumpToSection('forward')" + let b:undo_ftplugin .= " | silent! execute '" . s:mode . "unmap " . s:lhs . "'" + endfor + for s:lhs in ["[[", "[]"] + execute s:mode . "noremap " . s:lhs . " call jumpToSection('backward')" + let b:undo_ftplugin .= " | silent! execute '" . s:mode . "unmap " . s:lhs . "'" + endfor + endfor + unlet s:mode s:lhs endif let &cpo = s:save_cpo -- cgit From b9d9cd77421a7906d6e0a968a3c0ddd86e9923fe Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 9 Sep 2023 17:47:28 +0800 Subject: vim-patch:partial:9.0.1886: Various Typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Various Typos Solution: Fix Typos This is a collection of typo related commits. closes: vim/vim#12753 closes: vim/vim#13016 https://github.com/vim/vim/commit/ee17b6f70d382ec6c5d8d27b56c4e84106ac8c55 Co-authored-by: Christian Brabandt Co-authored-by: Adri Verhoef Co-authored-by: Viktor Szépe Co-authored-by: nuid64 Co-authored-by: Meng Xiangzhuo Co-authored-by: Dominique Pellé --- runtime/ftplugin/zig.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim index 2a081980cc..cfd7102b8d 100644 --- a/runtime/ftplugin/zig.vim +++ b/runtime/ftplugin/zig.vim @@ -39,7 +39,7 @@ endif let &l:define='\v(|||^\s*\#\s*define)' -" Safety check: don't execute zip from current directory +" Safety check: don't execute zig from current directory if !exists('g:zig_std_dir') && exists('*json_decode') && \ executable('zig') && get(g:, 'zig_exec', get(g:, 'plugin_exec', 0)) \ && (fnamemodify(exepath("zig"), ":p:h") != s:tmp_cwd -- cgit From 2dd5e472df8ed448375910d61c050390f7f17f5f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 12 Sep 2023 22:30:02 +0200 Subject: vim-patch:fc93594d562d runtime(rust): sync rust runtime files with upstream (vim/vim#13075) https://github.com/vim/vim/commit/fc93594d562dbbd9da03c89754538f91efd0c7ca Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com> --- runtime/ftplugin/rust.vim | 252 +++++++++++++++++++++++++++------------------- 1 file changed, 147 insertions(+), 105 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/rust.vim b/runtime/ftplugin/rust.vim index ececcced22..7f1a86ea95 100644 --- a/runtime/ftplugin/rust.vim +++ b/runtime/ftplugin/rust.vim @@ -1,20 +1,26 @@ " Language: Rust " Description: Vim ftplugin for Rust " Maintainer: Chris Morgan -" Maintainer: Lily Ballard -" Last Change: June 08, 2016 -" For bugs, patches and license go to https://github.com/rust-lang/rust.vim +" Last Change: 2023-09-11 +" For bugs, patches and license go to https://github.com/rust-lang/rust.vim if exists("b:did_ftplugin") - finish + finish endif let b:did_ftplugin = 1 +" vint: -ProhibitAbbreviationOption let s:save_cpo = &cpo set cpo&vim - -augroup rust.vim -autocmd! +" vint: +ProhibitAbbreviationOption + +if get(b:, 'current_compiler', '') ==# '' + if strlen(findfile('Cargo.toml', '.;')) > 0 + compiler cargo + else + compiler rustc + endif +endif " Variables {{{1 @@ -22,13 +28,13 @@ autocmd! " comments, so we'll use that as our default, but make it easy to switch. " This does not affect indentation at all (I tested it with and without " leader), merely whether a leader is inserted by default or not. -if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader != 0 - " Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why, - " but without it, */ gets indented one space even if there were no - " leaders. I'm fairly sure that's a Vim bug. - setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,:// +if get(g:, 'rust_bang_comment_leader', 0) + " Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why, + " but without it, */ gets indented one space even if there were no + " leaders. I'm fairly sure that's a Vim bug. + setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,:// else - setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// + setlocal comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// endif setlocal commentstring=//%s setlocal formatoptions-=t formatoptions+=croqnl @@ -39,13 +45,14 @@ silent! setlocal formatoptions+=j " otherwise it's better than nothing. setlocal smartindent nocindent -if !exists("g:rust_recommended_style") || g:rust_recommended_style != 0 - setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab - setlocal textwidth=99 +if get(g:, 'rust_recommended_style', 1) + let b:rust_set_style = 1 + setlocal shiftwidth=4 softtabstop=4 expandtab + setlocal textwidth=99 endif -" This includeexpr isn't perfect, but it's a good start -setlocal includeexpr=substitute(v:fname,'::','/','g') +setlocal include=\\v^\\s*(pub\\s+)?use\\s+\\zs(\\f\|:)+ +setlocal includeexpr=rust#IncludeExpr(v:fname) setlocal suffixesadd=.rs @@ -54,51 +61,36 @@ if exists("g:ftplugin_rust_source_path") endif if exists("g:loaded_delimitMate") - if exists("b:delimitMate_excluded_regions") - let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions - endif - - let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate' - - " For this buffer, when delimitMate issues the `User delimitMate_map` - " event in the autocommand system, add the above-defined extra excluded - " regions to delimitMate's state, if they have not already been added. - autocmd User - \ if expand('') ==# 'delimitMate_map' && match( - \ delimitMate#Get("excluded_regions"), - \ s:delimitMate_extra_excluded_regions) == -1 - \| let b:delimitMate_excluded_regions = - \ delimitMate#Get("excluded_regions") - \ . s:delimitMate_extra_excluded_regions - \|endif - - " For this buffer, when delimitMate issues the `User delimitMate_unmap` - " event in the autocommand system, delete the above-defined extra excluded - " regions from delimitMate's state (the deletion being idempotent and - " having no effect if the extra excluded regions are not present in the - " targeted part of delimitMate's state). - autocmd User - \ if expand('') ==# 'delimitMate_unmap' - \| let b:delimitMate_excluded_regions = substitute( - \ delimitMate#Get("excluded_regions"), - \ '\C\V' . s:delimitMate_extra_excluded_regions, - \ '', 'g') - \|endif + if exists("b:delimitMate_excluded_regions") + let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions + endif + + augroup rust.vim.DelimitMate + autocmd! + + autocmd User delimitMate_map :call rust#delimitmate#onMap() + autocmd User delimitMate_unmap :call rust#delimitmate#onUnmap() + augroup END +endif + +" Integration with auto-pairs (https://github.com/jiangmiao/auto-pairs) +if exists("g:AutoPairsLoaded") && !get(g:, 'rust_keep_autopairs_default', 0) + let b:AutoPairs = {'(':')', '[':']', '{':'}','"':'"', '`':'`'} endif -if has("folding") && exists('g:rust_fold') && g:rust_fold != 0 - let b:rust_set_foldmethod=1 - setlocal foldmethod=syntax - if g:rust_fold == 2 - setlocal foldlevel< - else - setlocal foldlevel=99 - endif +if has("folding") && get(g:, 'rust_fold', 0) + let b:rust_set_foldmethod=1 + setlocal foldmethod=syntax + if g:rust_fold == 2 + setlocal foldlevel< + else + setlocal foldlevel=99 + endif endif -if has('conceal') && exists('g:rust_conceal') && g:rust_conceal != 0 - let b:rust_set_conceallevel=1 - setlocal conceallevel=2 +if has('conceal') && get(g:, 'rust_conceal', 0) + let b:rust_set_conceallevel=1 + setlocal conceallevel=2 endif " Motion Commands {{{1 @@ -126,72 +118,122 @@ command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", ) command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", ) " See |:RustPlay| for docs -command! -range=% RustPlay :call rust#Play(, , , ) +command! -range=% -buffer RustPlay :call rust#Play(, , , ) " See |:RustFmt| for docs -command! -buffer RustFmt call rustfmt#Format() +command! -bar -buffer RustFmt call rustfmt#Format() " See |:RustFmtRange| for docs command! -range -buffer RustFmtRange call rustfmt#FormatRange(, ) -" Mappings {{{1 +" See |:RustInfo| for docs +command! -bar -buffer RustInfo call rust#debugging#Info() + +" See |:RustInfoToClipboard| for docs +command! -bar -buffer RustInfoToClipboard call rust#debugging#InfoToClipboard() + +" See |:RustInfoToFile| for docs +command! -bar -nargs=1 -buffer RustInfoToFile call rust#debugging#InfoToFile() -" Bind ⌘R in MacVim to :RustRun -nnoremap :RustRun -" Bind ⌘⇧R in MacVim to :RustRun! pre-filled with the last args -nnoremap :RustRun! =join(b:rust_last_rustc_args)erust#AppendCmdLine(' -- ' . join(b:rust_last_args)) +" See |:RustTest| for docs +command! -buffer -nargs=* -count -bang RustTest call rust#Test(, , 0, ) if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args") - let b:rust_last_rustc_args = [] - let b:rust_last_args = [] + let b:rust_last_rustc_args = [] + let b:rust_last_args = [] endif " Cleanup {{{1 let b:undo_ftplugin = " - \ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd< - \|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth< - \|if exists('b:rust_original_delimitMate_excluded_regions') - \|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions - \|unlet b:rust_original_delimitMate_excluded_regions - \|else - \|unlet! b:delimitMate_excluded_regions - \|endif - \|if exists('b:rust_set_foldmethod') - \|setlocal foldmethod< foldlevel< - \|unlet b:rust_set_foldmethod - \|endif - \|if exists('b:rust_set_conceallevel') - \|setlocal conceallevel< - \|unlet b:rust_set_conceallevel - \|endif - \|unlet! b:rust_last_rustc_args b:rust_last_args - \|delcommand RustRun - \|delcommand RustExpand - \|delcommand RustEmitIr - \|delcommand RustEmitAsm - \|delcommand RustPlay - \|nunmap - \|nunmap - \|nunmap [[ - \|nunmap ]] - \|xunmap [[ - \|xunmap ]] - \|ounmap [[ - \|ounmap ]] - \|set matchpairs-=<:> - \" + \ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd< + \|if exists('b:rust_set_style') + \|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth< + \|endif + \|if exists('b:rust_original_delimitMate_excluded_regions') + \|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions + \|unlet b:rust_original_delimitMate_excluded_regions + \|else + \|unlet! b:delimitMate_excluded_regions + \|endif + \|if exists('b:rust_set_foldmethod') + \|setlocal foldmethod< foldlevel< + \|unlet b:rust_set_foldmethod + \|endif + \|if exists('b:rust_set_conceallevel') + \|setlocal conceallevel< + \|unlet b:rust_set_conceallevel + \|endif + \|unlet! b:rust_last_rustc_args b:rust_last_args + \|delcommand -buffer RustRun + \|delcommand -buffer RustExpand + \|delcommand -buffer RustEmitIr + \|delcommand -buffer RustEmitAsm + \|delcommand -buffer RustPlay + \|delcommand -buffer RustFmt + \|delcommand -buffer RustFmtRange + \|delcommand -buffer RustInfo + \|delcommand -buffer RustInfoToClipboard + \|delcommand -buffer RustInfoToFile + \|delcommand -buffer RustTest + \|nunmap [[ + \|nunmap ]] + \|xunmap [[ + \|xunmap ]] + \|ounmap [[ + \|ounmap ]] + \|setlocal matchpairs-=<:> + \|unlet b:match_skip + \" " }}}1 " Code formatting on save -if get(g:, "rustfmt_autosave", 0) - autocmd BufWritePre *.rs silent! call rustfmt#Format() -endif - +augroup rust.vim.PreWrite + autocmd! + autocmd BufWritePre *.rs silent! call rustfmt#PreWrite() augroup END +setlocal matchpairs+=<:> +" For matchit.vim (rustArrow stops `Fn() -> X` messing things up) +let b:match_skip = 's:comment\|string\|rustCharacter\|rustArrow' + +command! -buffer -nargs=+ Cargo call cargo#cmd() +command! -buffer -nargs=* Cbuild call cargo#build() +command! -buffer -nargs=* Ccheck call cargo#check() +command! -buffer -nargs=* Cclean call cargo#clean() +command! -buffer -nargs=* Cdoc call cargo#doc() +command! -buffer -nargs=+ Cnew call cargo#new() +command! -buffer -nargs=* Cinit call cargo#init() +command! -buffer -nargs=* Crun call cargo#run() +command! -buffer -nargs=* Ctest call cargo#test() +command! -buffer -nargs=* Cbench call cargo#bench() +command! -buffer -nargs=* Cupdate call cargo#update() +command! -buffer -nargs=* Csearch call cargo#search() +command! -buffer -nargs=* Cpublish call cargo#publish() +command! -buffer -nargs=* Cinstall call cargo#install() +command! -buffer -nargs=* Cruntarget call cargo#runtarget() + +let b:undo_ftplugin .= ' + \|delcommand -buffer Cargo + \|delcommand -buffer Cbuild + \|delcommand -buffer Ccheck + \|delcommand -buffer Cclean + \|delcommand -buffer Cdoc + \|delcommand -buffer Cnew + \|delcommand -buffer Cinit + \|delcommand -buffer Crun + \|delcommand -buffer Ctest + \|delcommand -buffer Cbench + \|delcommand -buffer Cupdate + \|delcommand -buffer Csearch + \|delcommand -buffer Cpublish + \|delcommand -buffer Cinstall + \|delcommand -buffer Cruntarget' + +" vint: -ProhibitAbbreviationOption let &cpo = s:save_cpo unlet s:save_cpo +" vint: +ProhibitAbbreviationOption -" vim: set noet sw=8 ts=8: +" vim: set et sw=4 sts=4 ts=8: -- cgit From be10d65bfafe056025ffffa2c1131712b9a493a5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 15 Sep 2023 16:50:03 +0200 Subject: vim-patch:c1f8bb37c6a8 runtime(forth): Fix :unlet error in ftplugin (vim/vim#13090) Fixes vim/vim#13089. https://github.com/vim/vim/commit/c1f8bb37c6a8e0babc2a41f16860763b57c23fa1 Co-authored-by: dkearns --- runtime/ftplugin/forth.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/forth.vim b/runtime/ftplugin/forth.vim index 5343784a21..d28c8484e1 100644 --- a/runtime/ftplugin/forth.vim +++ b/runtime/ftplugin/forth.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Forth " Maintainer: Johan Kotlinski -" Last Change: 2023 Aug 08 +" Last Change: 2023 Sep 15 " URL: https://github.com/jkotlinski/forth.vim if exists("b:did_ftplugin") @@ -58,6 +58,7 @@ if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 1 let b:match_words = s:matchit_patterns[1:]->join(',') let b:undo_ftplugin ..= "| unlet! b:match_ignorecase b:match_words" + unlet s:matchit_patterns endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") @@ -68,4 +69,4 @@ endif let &cpo = s:cpo_save unlet s:cpo_save -unlet s:define_patterns s:include_patterns s:matchit_patterns +unlet s:define_patterns s:include_patterns -- cgit From 1b74d2bf0aceed1866f8a6f07403617fb37a0aa7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 17 Sep 2023 19:19:33 +0200 Subject: vim-patch:e30d8e4ce01d runtime(kotlin): Add Kotlin runtime files (vim/vim#13110) Closes udalov/kotlin-vimvim/vim#39 https://github.com/vim/vim/commit/e30d8e4ce01dc1aca95d25be9fd27c09855fd4be Co-authored-by: dkearns --- runtime/ftplugin/kotlin.vim | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 runtime/ftplugin/kotlin.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/kotlin.vim b/runtime/ftplugin/kotlin.vim new file mode 100644 index 0000000000..b21de603ea --- /dev/null +++ b/runtime/ftplugin/kotlin.vim @@ -0,0 +1,33 @@ +" Vim filetype plugin file +" Language: Kotlin +" Maintainer: Alexander Udalov +" URL: https://github.com/udalov/kotlin-vim +" Last Change: 7 November 2021 +" 2023 Sep 17 by Vim Project (browsefilter) + +if exists('b:did_ftplugin') | finish | endif +let b:did_ftplugin = 1 + +let s:save_cpo = &cpo +set cpo&vim + +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// +setlocal commentstring=//\ %s + +setlocal formatoptions-=t formatoptions+=croqnl +silent! setlocal formatoptions+=j + +setlocal includeexpr=substitute(v:fname,'\\.','/','g') +setlocal suffixesadd=.kt + +let b:undo_ftplugin = "setlocal comments< commentstring< ". + \ "formatoptions< includeexpr< suffixesadd<" + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Kotlin Source Files (*.kt, *kts)\t*.kt;*.kts\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" +endif + +let &cpo = s:save_cpo +unlet s:save_cpo -- cgit From 3387dc4a463c80a01702cdd069dde3d505a4e805 Mon Sep 17 00:00:00 2001 From: ricardaxel <46921637+ricardaxel@users.noreply.github.com> Date: Tue, 26 Sep 2023 00:13:58 +0200 Subject: fix(runtime): add commentstring for D ftplugin (#25362) Problem: No commentstring is set for D buffers after removing the default C-style commentstring Same solution than neovim#23039 Co-authored-by: Axel Ricard --- runtime/ftplugin/d.lua | 1 + 1 file changed, 1 insertion(+) create mode 100644 runtime/ftplugin/d.lua (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/d.lua b/runtime/ftplugin/d.lua new file mode 100644 index 0000000000..b4e68148f5 --- /dev/null +++ b/runtime/ftplugin/d.lua @@ -0,0 +1 @@ +vim.bo.commentstring = '/*%s*/' -- cgit From ddc147da2f5d5ec565873587c11725a1fd355d8b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 25 Sep 2023 22:15:12 +0200 Subject: vim-patch:54e1f56cf2a5 runtime(sh): only invoke bash help in ftplugin if it has been detected to be bash (vim/vim#13171) https://github.com/vim/vim/commit/54e1f56cf2a5f74ee11baba170afff867e5d9f99 Co-authored-by: Eisuke Kawashima --- runtime/ftplugin/sh.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim index 4409f3f90c..c227838d18 100644 --- a/runtime/ftplugin/sh.vim +++ b/runtime/ftplugin/sh.vim @@ -39,8 +39,7 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif -if (exists("b:is_bash") && (b:is_bash == 1)) || - \ (exists("b:is_sh") && (b:is_sh == 1)) +if (exists("b:is_bash") && (b:is_bash == 1)) if !has("gui_running") && executable("less") command! -buffer -nargs=1 Help silent exe '!bash -c "{ help "" 2>/dev/null || man ""; } | LESS= less"' | redraw! elseif has('terminal') -- cgit From 555f492ec66ed51aaeddd54eb8a476a95a4d90b3 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 27 Sep 2023 19:29:05 +0200 Subject: vim-patch:347459423903 runtime(rmd) Update ftplugin and syntax files (vim/vim#13193) ftplugin/rmd.vim: - Set 'commentstring' dynamically according to code region. syntax/rmd.vim: - Include syntax highlighting of fenced languages dynamically. - Add conceal char for line break. https://github.com/vim/vim/commit/34745942390383ec626b168e9837d284622c7bbe Co-authored-by: Jakson Alves de Aquino --- runtime/ftplugin/rmd.vim | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/rmd.vim b/runtime/ftplugin/rmd.vim index be6ab7335b..a407c236dd 100644 --- a/runtime/ftplugin/rmd.vim +++ b/runtime/ftplugin/rmd.vim @@ -2,7 +2,7 @@ " Language: R Markdown file " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Mon Feb 27, 2023 07:15PM +" Last Change: Mon May 29, 2023 06:31AM " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann) " Only do this when not yet done for this buffer @@ -32,12 +32,18 @@ function FormatRmd() return 1 endfunction +let s:last_line = 0 function SetRmdCommentStr() - if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW')) - set commentstring=#\ %s - else - set commentstring= - endif + if line('.') == s:last_line + return + endif + let s:last_line = line('.') + + if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW')) + set commentstring=#\ %s + else + set commentstring= + endif endfunction " If you do not want both 'comments' and 'commentstring' dynamically defined, -- cgit From e7c268e38f146cfc81b91c185c17b333e2f6364d Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 6 Oct 2023 22:50:17 +0200 Subject: vim-patch:2a281ccca017 runtime(sh): Update ftplugin (vim/vim#13213) Rename 'keywordprg' user command to ShKeywordPrg as this is just a leaking implementation detail. https://github.com/vim/vim/commit/2a281ccca017fb5e8ffd20a86aa390431224a2fd Co-authored-by: dkearns --- runtime/ftplugin/sh.vim | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim index c227838d18..c1a6bc5ade 100644 --- a/runtime/ftplugin/sh.vim +++ b/runtime/ftplugin/sh.vim @@ -3,7 +3,8 @@ " Maintainer: Doug Kearns " Previous Maintainer: Dan Sharp " Contributor: Enno Nagel -" Last Change: 2023 Aug 29 +" Eisuke Kawashima +" Last Change: 2023 Sep 28 if exists("b:did_ftplugin") finish @@ -39,16 +40,16 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif -if (exists("b:is_bash") && (b:is_bash == 1)) +if get(b:, "is_bash", 0) if !has("gui_running") && executable("less") - command! -buffer -nargs=1 Help silent exe '!bash -c "{ help "" 2>/dev/null || man ""; } | LESS= less"' | redraw! - elseif has('terminal') - command! -buffer -nargs=1 Help silent exe ':term bash -c "help "" 2>/dev/null || man """' + command! -buffer -nargs=1 ShKeywordPrg silent exe '!bash -c "{ help "" 2>/dev/null || man ""; } | LESS= less"' | redraw! + elseif has("terminal") + command! -buffer -nargs=1 ShKeywordPrg silent exe ':term bash -c "help "" 2>/dev/null || man """' else - command! -buffer -nargs=1 Help echo system('bash -c "help " 2>/dev/null || man ""') + command! -buffer -nargs=1 ShKeywordPrg echo system('bash -c "help " 2>/dev/null || man ""') endif - setlocal keywordprg=:Help - let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer Help" + setlocal keywordprg=:ShKeywordPrg + let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer ShKeywordPrg" endif let &cpo = s:save_cpo -- cgit From e5855697e90e379128a018a8d88cf5ec008b0623 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 8 Oct 2023 19:17:19 +0200 Subject: vim-patch:1e33cd72b60a runtime: make command name for &iskeywordprg more unique (vim/vim#13297) See https://github.com/vim/vim/pull/13213/commits by @dkearns: Rename 'keywordprg' user command to ShKeywordPrg as this is just a leaking implementation detail. https://github.com/vim/vim/commit/1e33cd72b60a119a038952bb658862d038602f76 Co-authored-by: Enno --- runtime/ftplugin/gpg.vim | 12 ++++++------ runtime/ftplugin/modconf.vim | 12 ++++++------ runtime/ftplugin/muttrc.vim | 12 ++++++------ runtime/ftplugin/readline.vim | 10 +++++----- runtime/ftplugin/sshconfig.vim | 12 ++++++------ runtime/ftplugin/sudoers.vim | 12 ++++++------ runtime/ftplugin/systemd.vim | 11 ++++++----- runtime/ftplugin/udevrules.vim | 12 ++++++------ runtime/ftplugin/zsh.vim | 12 ++++++------ 9 files changed, 53 insertions(+), 52 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/gpg.vim b/runtime/ftplugin/gpg.vim index 2415555e09..7fb4f47ed8 100644 --- a/runtime/ftplugin/gpg.vim +++ b/runtime/ftplugin/gpg.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: gpg(1) configuration file " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" Latest Revision: 2023-10-07 if exists("b:did_ftplugin") finish @@ -17,17 +17,17 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql if has('unix') && executable('less') if !has('gui_running') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 GpgKeywordPrg \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+--' . . '\b'' --hilite-search" man ' . 'gpg' | \ redraw! elseif has('terminal') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 GpgKeywordPrg \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . . '\b', '\') . ''' --hilite-search" man ' . 'gpg' endif - if exists(':Sman') == 2 + if exists(':GpgKeywordPrg') == 2 setlocal iskeyword+=- - setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' + setlocal keywordprg=:GpgKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer GpgKeywordPrg' endif endif diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim index d5eda5af21..22d18a9aad 100644 --- a/runtime/ftplugin/modconf.vim +++ b/runtime/ftplugin/modconf.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: modules.conf(5) configuration file " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" Latest Revision: 2023-10-07 if exists("b:did_ftplugin") finish @@ -18,17 +18,17 @@ setlocal formatoptions-=t formatoptions+=croql if has('unix') && executable('less') if !has('gui_running') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 ModconfKeywordPrg \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . . '\b'' --hilite-search" man ' . 'modprobe.d' | \ redraw! elseif has('terminal') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 ModconfKeywordPrg \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d' endif - if exists(':Sman') == 2 + if exists(':ModconfKeywordPrg') == 2 setlocal iskeyword+=- - setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' + setlocal keywordprg=:ModconfKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ModconfKeywordPrg' endif endif diff --git a/runtime/ftplugin/muttrc.vim b/runtime/ftplugin/muttrc.vim index 7a4eb7a8bb..c9f6df31d0 100644 --- a/runtime/ftplugin/muttrc.vim +++ b/runtime/ftplugin/muttrc.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: mutt RC File " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Latest Revision: 2023-10-07 if exists("b:did_ftplugin") finish @@ -20,17 +20,17 @@ let &l:include = '^\s*source\>' if has('unix') && executable('less') if !has('gui_running') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 MuttrcKeywordPrg \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . . '\b'' --hilite-search" man ' . 'muttrc' | \ redraw! elseif has('terminal') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 MuttrcKeywordPrg \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . . '\b', '\') . ''' --hilite-search" man ' . 'muttrc' endif - if exists(':Sman') == 2 + if exists(':MuttrcKeywordPrg') == 2 setlocal iskeyword+=- - setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' + setlocal keywordprg=:MuttrcKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer MuttrcKeywordPrg' endif endif diff --git a/runtime/ftplugin/readline.vim b/runtime/ftplugin/readline.vim index a696da2701..181d8ac661 100644 --- a/runtime/ftplugin/readline.vim +++ b/runtime/ftplugin/readline.vim @@ -32,17 +32,17 @@ endif if has('unix') && executable('less') if !has('gui_running') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 ReadlineKeywordPrg \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . . '\b'' --hilite-search" man ' . '3 readline' | \ redraw! elseif has('terminal') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 ReadlineKeywordPrg \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . . '\b', '\') . ''' --hilite-search" man ' . '3 readline' endif - if exists(':Sman') == 2 + if exists(':ReadlineKeywordPrg') == 2 setlocal iskeyword+=- - setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' + setlocal keywordprg=:ReadlineKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg' endif endif diff --git a/runtime/ftplugin/sshconfig.vim b/runtime/ftplugin/sshconfig.vim index c9a5cfaa68..4a054da52f 100644 --- a/runtime/ftplugin/sshconfig.vim +++ b/runtime/ftplugin/sshconfig.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: OpenSSH client configuration file " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" Latest Revision: 2023-10-07 if exists("b:did_ftplugin") finish @@ -16,17 +16,17 @@ let b:undo_ftplugin = 'setlocal com< cms< fo<' if has('unix') && executable('less') if !has('gui_running') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 SshconfigKeywordPrg \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . . '$'' --hilite-search" man ' . 'ssh_config' | \ redraw! elseif has('terminal') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 SshconfigKeywordPrg \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . . '$', '\') . ''' --hilite-search" man ' . 'ssh_config' endif - if exists(':Sman') == 2 + if exists(':SshconfigKeywordPrg') == 2 setlocal iskeyword+=- - setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' + setlocal keywordprg=:SshconfigKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SshconfigKeywordPrg' endif endif diff --git a/runtime/ftplugin/sudoers.vim b/runtime/ftplugin/sudoers.vim index b4123620af..81ce7906a9 100644 --- a/runtime/ftplugin/sudoers.vim +++ b/runtime/ftplugin/sudoers.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: sudoers(5) configuration files " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" Latest Revision: 2023-10-07 if exists("b:did_ftplugin") finish @@ -17,17 +17,17 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql if has('unix') && executable('less') if !has('gui_running') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 SudoersKeywordPrg \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''\b' . . '\b'' --hilite-search" man ' . 'sudoers' | \ redraw! elseif has('terminal') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 SudoersKeywordPrg \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . . '\b', '\') . ''' --hilite-search" man ' . 'sudoers' endif - if exists(':Sman') == 2 + if exists(':SudoersKeywordPrg') == 2 setlocal iskeyword+=- - setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' + setlocal keywordprg=:SudoersKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SudoersKeywordPrg' endif endif diff --git a/runtime/ftplugin/systemd.vim b/runtime/ftplugin/systemd.vim index e60a5e4960..8bcacdd381 100644 --- a/runtime/ftplugin/systemd.vim +++ b/runtime/ftplugin/systemd.vim @@ -1,6 +1,7 @@ " Vim filetype plugin file " Language: systemd.unit(5) " Keyword Lookup Support: Enno Nagel +" Latest Revision: 2023-10-07 if !exists('b:did_ftplugin') " Looks a lot like dosini files. @@ -9,11 +10,11 @@ endif if has('unix') && executable('less') if !has('gui_running') - command -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd() | redraw! + command -buffer -nargs=1 SystemdKeywordPrg silent exe '!' . KeywordLookup_systemd() | redraw! elseif has('terminal') - command -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd() + command -buffer -nargs=1 SystemdKeywordPrg silent exe 'term ' . KeywordLookup_systemd() endif - if exists(':Sman') == 2 + if exists(':SystemdKeywordPrg') == 2 if !exists('*KeywordLookup_systemd') function KeywordLookup_systemd(keyword) abort let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$') @@ -26,11 +27,11 @@ if has('unix') && executable('less') endfunction endif setlocal iskeyword+=- - setlocal keywordprg=:Sman + setlocal keywordprg=:SystemdKeywordPrg if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<' else - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SystemdKeywordPrg' endif endif endif diff --git a/runtime/ftplugin/udevrules.vim b/runtime/ftplugin/udevrules.vim index 83fb728a54..ec365f04c2 100644 --- a/runtime/ftplugin/udevrules.vim +++ b/runtime/ftplugin/udevrules.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: udev(8) rules file " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" Latest Revision: 2023-10-07 if exists("b:did_ftplugin") finish @@ -17,17 +17,17 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql if has('unix') && executable('less') if !has('gui_running') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 UdevrulesKeywordPrg \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . . '\b'' --hilite-search" man ' . 'udev' | \ redraw! elseif has('terminal') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 UdevrulesKeywordPrg \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . . '\b', '\') . ''' --hilite-search" man ' . 'udev' endif - if exists(':Sman') == 2 + if exists(':UdevrulesKeywordPrg') == 2 setlocal iskeyword+=- - setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' + setlocal keywordprg=:UdevrulesKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer UdevrulesKeywordPrg' endif endif diff --git a/runtime/ftplugin/zsh.vim b/runtime/ftplugin/zsh.vim index ed75d04003..40986fccbe 100644 --- a/runtime/ftplugin/zsh.vim +++ b/runtime/ftplugin/zsh.vim @@ -2,7 +2,7 @@ " Language: Zsh shell script " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2021-04-03 +" Latest Revision: 2023-10-07 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-zsh @@ -20,17 +20,17 @@ let b:undo_ftplugin = "setl com< cms< fo< " if executable('zsh') && &shell !~# '/\%(nologin\|false\)$' if !has('gui_running') && executable('less') - command! -buffer -nargs=1 RunHelp silent exe '!MANPAGER= zsh -c "autoload -Uz run-help; run-help 2>/dev/null | LESS= less"' | redraw! + command! -buffer -nargs=1 ZshKeywordPrg silent exe '!MANPAGER= zsh -c "autoload -Uz run-help; run-help 2>/dev/null | LESS= less"' | redraw! elseif has('terminal') - command! -buffer -nargs=1 RunHelp silent exe ':term zsh -c "autoload -Uz run-help; run-help "' + command! -buffer -nargs=1 ZshKeywordPrg silent exe ':term zsh -c "autoload -Uz run-help; run-help "' else - command! -buffer -nargs=1 RunHelp echo system('zsh -c "autoload -Uz run-help; run-help 2>/dev/null"') + command! -buffer -nargs=1 ZshKeywordPrg echo system('zsh -c "autoload -Uz run-help; run-help 2>/dev/null"') endif if !exists('current_compiler') compiler zsh endif - setlocal keywordprg=:RunHelp - let b:undo_ftplugin .= 'keywordprg< | sil! delc -buffer RunHelp' + setlocal keywordprg=:ZshKeywordPrg + let b:undo_ftplugin .= 'keywordprg< | sil! delc -buffer ZshKeywordPrg' endif let b:match_words = '\:\:\:\' -- cgit From 28ef4a44925a1b1cbf291347aba43012ab038523 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 14 Oct 2023 16:04:05 +0200 Subject: vim-patch:7687238e1b0d runtime(tcsh): Update ftplugin (vim/vim#13327) Fix b:browsefilter deletion error when calling b:undo_ftplugin. Fixes vim/vim#13167 https://github.com/vim/vim/commit/7687238e1b0d2f26ba57e1bdf76f782eaa43af3a Co-authored-by: dkearns --- runtime/ftplugin/csh.vim | 17 ++++++++++------- runtime/ftplugin/tcsh.vim | 20 ++++++++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/csh.vim b/runtime/ftplugin/csh.vim index ca5da5a8b9..2feec57bb2 100644 --- a/runtime/ftplugin/csh.vim +++ b/runtime/ftplugin/csh.vim @@ -3,9 +3,11 @@ " Maintainer: Doug Kearns " Previous Maintainer: Dan Sharp " Contributor: Johannes Zellner -" Last Change: 2021 Oct 15 +" Last Change: 2023 Oct 09 -if exists("b:did_ftplugin") | finish | endif +if exists("b:did_ftplugin") + finish +endif let b:did_ftplugin = 1 let s:save_cpo = &cpo @@ -18,7 +20,7 @@ setlocal formatoptions+=crql let b:undo_ftplugin = "setlocal com< cms< fo<" -" Csh: thanks to Johannes Zellner +" Csh: thanks to Johannes Zellner " - Both foreach and end must appear alone on separate lines. " - The words else and endif must appear at the beginning of input lines; " the if must appear alone on its input line or after an else. @@ -38,13 +40,14 @@ if exists("loaded_matchit") && !exists("b:match_words") \ s:line_start .. 'case\s\+:' .. s:line_start .. 'default\>:\:' .. \ s:line_start .. 'endsw\>' unlet s:line_start - let b:undo_ftplugin ..= " | unlet b:match_words" + let b:undo_ftplugin ..= " | unlet! b:match_words" endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter="csh Scripts (*.csh)\t*.csh\n" .. - \ "All Files (*.*)\t*.*\n" - let b:undo_ftplugin ..= " | unlet b:browsefilter" + let b:browsefilter = "csh Scripts (*.csh)\t*.csh\n" .. + \ "All Files (*.*)\t*.*\n" + let b:csh_set_browsefilter = 1 + let b:undo_ftplugin ..= " | unlet! b:browsefilter b:csh_set_browsefilter" endif let &cpo = s:save_cpo diff --git a/runtime/ftplugin/tcsh.vim b/runtime/ftplugin/tcsh.vim index 85d3873b33..b2467b43a2 100644 --- a/runtime/ftplugin/tcsh.vim +++ b/runtime/ftplugin/tcsh.vim @@ -2,9 +2,11 @@ " Language: tcsh " Maintainer: Doug Kearns " Previous Maintainer: Dan Sharp -" Last Change: 2021 Oct 15 +" Last Change: 2023 Oct 09 -if exists("b:did_ftplugin") | finish | endif +if exists("b:did_ftplugin") + finish +endif let s:save_cpo = &cpo set cpo-=C @@ -12,24 +14,26 @@ set cpo-=C " Define some defaults in case the included ftplugins don't set them. let s:undo_ftplugin = "" let s:browsefilter = "csh Files (*.csh)\t*.csh\n" .. - \ "All Files (*.*)\t*.*\n" + \ "All Files (*.*)\t*.*\n" runtime! ftplugin/csh.vim ftplugin/csh_*.vim ftplugin/csh/*.vim let b:did_ftplugin = 1 " Override our defaults if these were set by an included ftplugin. if exists("b:undo_ftplugin") - let s:undo_ftplugin = b:undo_ftplugin + let s:undo_ftplugin = b:undo_ftplugin endif if exists("b:browsefilter") - let s:browsefilter = b:browsefilter + let s:browsefilter = b:browsefilter endif -if (has("gui_win32") || has("gui_gtk")) - let b:browsefilter="tcsh Scripts (*.tcsh)\t*.tcsh\n" .. s:browsefilter +if (has("gui_win32") || has("gui_gtk")) && + \ (!exists("b:browsefilter") || exists("b:csh_set_browsefilter")) + let b:browsefilter = "tcsh Scripts (*.tcsh)\t*.tcsh\n" .. s:browsefilter + let s:undo_ftplugin = "unlet! b:browsefilter | " .. s:undo_ftplugin endif -let b:undo_ftplugin = "unlet! b:browsefilter | " .. s:undo_ftplugin +let b:undo_ftplugin = s:undo_ftplugin let &cpo = s:save_cpo unlet s:save_cpo -- cgit From e6d352d8d7d8a987d0bd9b2e13bfd395e1127c3e Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Thu, 19 Oct 2023 10:20:12 -0500 Subject: vim-patch:e08bfef88bd0 runtime(zig): Update Zig runtime files (vim/vim#13388) Update runtime files from upstream (https://github.com/zig/zig.vim) at commit 54c216e5306a5c3878a60596aacb94dca8652ab9. https://github.com/vim/vim/commit/e08bfef88bd05a9d27ee16c57cd10173e280f600 Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com> --- runtime/ftplugin/zig.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim index cfd7102b8d..291fe44b11 100644 --- a/runtime/ftplugin/zig.vim +++ b/runtime/ftplugin/zig.vim @@ -28,7 +28,7 @@ setlocal formatoptions-=t formatoptions+=croql setlocal suffixesadd=.zig,.zir if has('comments') - setlocal comments=:///,://!,://,:\\\\ + setlocal comments=:///,://!,:// setlocal commentstring=//\ %s endif @@ -53,7 +53,7 @@ endif unlet! s:tmp_cwd if exists('g:zig_std_dir') - let &l:path = &l:path . ',' . g:zig_std_dir + let &l:path = g:zig_std_dir . ',' . &l:path endif let b:undo_ftplugin = -- cgit From 594ff34581907fed4956d4dc93c033dfdd5f7a69 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:22:51 -0500 Subject: vim-patch:d5dc58aeed1b (#25720) runtime(json5): Add new ftplugin (vim/vim#13385) https://github.com/vim/vim/commit/d5dc58aeed1b3e76527685d04906afd634d45949 Co-authored-by: dkearns --- runtime/ftplugin/json5.vim | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 runtime/ftplugin/json5.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/json5.vim b/runtime/ftplugin/json5.vim new file mode 100644 index 0000000000..2560857a33 --- /dev/null +++ b/runtime/ftplugin/json5.vim @@ -0,0 +1,28 @@ +" Vim filetype plugin file +" Language: JSON5 +" Maintainer: Doug Kearns +" Last Change: 2023 Oct 19 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// +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 = "JSON5 Files (*.json5)\t*.json5\n" .. + \ "JSON Files (*.json)\t*.json\n" .. + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save -- cgit From e606604322815abd3dc91a5595a0aa976a9aded7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 23 Oct 2023 18:20:12 +0200 Subject: vim-patch:fea96c00e55a runtime(vim): Update ftplugin - comment motions (vim/vim#13412) Fix the pattern used by comment-motion mappings to match the start of a block comment. Block-comment start lines were being ignored if the previous line contained a double-quote character anywhere in the line. Line comments should only be ignored if the previous line is a full-line comment and, therefore, part of the current block comment. https://github.com/vim/vim/commit/fea96c00e55a71e3007907ff4f7ad513bb9ff0eb Co-authored-by: dkearns --- runtime/ftplugin/vim.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 3b10c95c80..06369e8a82 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -84,8 +84,8 @@ if !exists("no_plugin_maps") && !exists("no_vim_maps") vnoremap ][ m':exe "normal! gv"call search('^\s*end\(f\%[unction]\\|def\)\>', "W") " Move around comments - nnoremap ]" :call search('^\(\s*".*\n\)\@ - vnoremap ]" :exe "normal! gv"call search('^\(\s*".*\n\)\@ + nnoremap ]" :call search('\%(^\s*".*\n\)\@ + vnoremap ]" :exe "normal! gv"call search('\%(^\s*".*\n\)\@ nnoremap [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") vnoremap [" :exe "normal! gv"call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW") endif -- cgit From 5753e5e7ebb60d26d78aa3c99a8b0e2ee8023056 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 27 Oct 2023 09:37:48 +0200 Subject: vim-patch:9.0.2071: objdump files not recognized Problem: objdump files not recognized Solution: detect *.objdump files, add a filetype plugin Added the objdump file/text format closes: vim/vim#13425 https://github.com/vim/vim/commit/10407df7a95d0311c7d2eb920d3b72020db5b301 Co-authored-by: Colin Kennedy --- runtime/ftplugin/objdump.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 runtime/ftplugin/objdump.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/objdump.vim b/runtime/ftplugin/objdump.vim new file mode 100644 index 0000000000..7517a342a3 --- /dev/null +++ b/runtime/ftplugin/objdump.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin file +" Language: Objdump +" Maintainer: Colin Kennedy +" Last Change: 2023 October 25 + +if exists("b:did_ftplugin") + finish +endif + +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setlocal cms<" + +setlocal commentstring=#\ %s -- cgit From 4fcdfa5ad01fd8f7e8c0e044fcf004692c0889d5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 27 Oct 2023 09:40:31 +0200 Subject: vim-patch:7b7cda67a124 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runtime(debian): update debian related runtime files (vim/vim#13423) * Update Debian runtime files Add mantic as a supported Ubuntu release and move buster/kinetic to unsupported. Add syntax highlighting for deb822sources filetype. Add debsources ftplugin to set relevant comment options. Move common version information to shared/debversions.vim Closes vim/vim#11934 * Add myself as codeowner for Debian-related runtime files --------- https://github.com/vim/vim/commit/7b7cda67a1246874520b280277d9b1447e1a7ef5 Co-authored-by: James McCoy Co-authored-by: Heinrich Schuchardt Co-authored-by: James Addison Co-authored-by: Viktor Szépe Co-authored-by: Heinrich Schuchardt Co-authored-by: James Addison Co-authored-by: Viktor Szépe --- runtime/ftplugin/debchangelog.vim | 2 +- runtime/ftplugin/debsources.vim | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 runtime/ftplugin/debsources.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim index dca7f7355a..aa657a9b97 100644 --- a/runtime/ftplugin/debchangelog.vim +++ b/runtime/ftplugin/debchangelog.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Michael Piefel " Stefano Zacchiroli -" Last Change: 2023 Jan 16 +" Last Change: 2023 Aug 18 " License: Vim License " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/debchangelog.vim diff --git a/runtime/ftplugin/debsources.vim b/runtime/ftplugin/debsources.vim new file mode 100644 index 0000000000..cbb4fafd22 --- /dev/null +++ b/runtime/ftplugin/debsources.vim @@ -0,0 +1,16 @@ +" Language: Debian sources.list +" Maintainer: Debian Vim Maintainers +" Last Change: 2023 Aug 30 +" License: Vim License +" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/debsources.vim + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin=1 + +setlocal comments=:# +setlocal commentstring=#%s +setlocal formatoptions-=t + +let b:undo_ftplugin = 'setlocal comments< commentstring< formatoptions<' -- cgit From 26cdff0e92bf93a2afcb4a78e056780ea3f582e7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 4 Nov 2023 11:37:42 +0100 Subject: vim-patch:cd8a3eaf5348 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runtime(dist): centralize safe executable check and add vim library (vim/vim#13413) Follow up to 816fbcc26 (patch 9.0.1833: [security] runtime file fixes, 2023-08-31) and f7ac0ef50 (runtime: don't execute external commands when loading ftplugins, 2023-09-06). This puts the logic for safe executable checks in a single place, by introducing a central vim library, so all filetypes benefit from consistency. Notable changes: - dist#vim because the (autoload) namespace for a new runtime support library. Supporting functions should get documentation. It might make life easier for NeoVim devs to make the documentation a new file rather than cram it into existing files, though we may want cross-references to it somewhere… - The gzip and zip plugins need to be opted into by enabling execution of those programs (or the global plugin_exec). This needs documentation or discussion. - This fixes a bug in the zig plugin: code setting s:tmp_cwd was removed in f7ac0ef50 (runtime: don't execute external commands when loading ftplugins, 2023-09-06), but the variable was still referenced. Since the new function takes care of that automatically, the variable is no longer needed. https://github.com/vim/vim/commit/cd8a3eaf5348feacfecab4b374b7ea4ce6a97422 Co-authored-by: D. Ben Knoble --- runtime/ftplugin/awk.vim | 4 ++-- runtime/ftplugin/changelog.vim | 4 ++-- runtime/ftplugin/perl.vim | 7 +------ runtime/ftplugin/zig.vim | 5 +---- 4 files changed, 6 insertions(+), 14 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/awk.vim b/runtime/ftplugin/awk.vim index 785088ff9b..40fe304cf4 100644 --- a/runtime/ftplugin/awk.vim +++ b/runtime/ftplugin/awk.vim @@ -37,8 +37,8 @@ if exists("g:awk_is_gawk") let b:undo_ftplugin .= " | setl fp<" endif - " Disabled by default for security reasons. - if get(g:, 'awk_exec', get(g:, 'plugin_exec', 0)) + " Disabled by default for security reasons. + if dist#vim#IsSafeExecutable('awk', 'gawk') let path = system("gawk 'BEGIN { printf ENVIRON[\"AWKPATH\"] }'") let path = substitute(path, '^\.\=:\|:\.\=$\|:\.\=:', ',,', 'g') " POSIX cwd let path = substitute(path, ':', ',', 'g') diff --git a/runtime/ftplugin/changelog.vim b/runtime/ftplugin/changelog.vim index a62433378a..ab73949be5 100644 --- a/runtime/ftplugin/changelog.vim +++ b/runtime/ftplugin/changelog.vim @@ -57,8 +57,8 @@ if &filetype == 'changelog' endif let s:default_login = 'unknown' - " Disabled by default for security reasons. - if get(g:, 'changelog_exec', get(g:, 'plugin_exec', 0)) + " Disabled by default for security reasons. + if dist#vim#IsSafeExecutable('changelog', 'whoami') let login = s:login() else let login = s:default_login diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim index 7ea0ae980a..c63bd3f9c7 100644 --- a/runtime/ftplugin/perl.vim +++ b/runtime/ftplugin/perl.vim @@ -56,12 +56,8 @@ endif " Set this once, globally. if !exists("perlpath") - let s:tmp_cwd = getcwd() " safety check: don't execute perl binary by default - if executable("perl") && get(g:, 'perl_exec', get(g:, 'plugin_exec', 0)) - \ && (fnamemodify(exepath("perl"), ":p:h") != s:tmp_cwd - \ || (index(split($PATH, has("win32") ? ';' : ':'), s:tmp_cwd) != -1 - \ && s:tmp_cwd != '.')) + if dist#vim#IsSafeExecutable('perl', 'perl') try if &shellxquote != '"' let perlpath = system('perl -e "print join(q/,/,@INC)"') @@ -77,7 +73,6 @@ if !exists("perlpath") " current directory and the directory of the current file. let perlpath = ".,," endif - unlet! s:tmp_cwd endif " Append perlpath to the existing path value, if it is set. Since we don't diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim index 291fe44b11..28b8cd5a67 100644 --- a/runtime/ftplugin/zig.vim +++ b/runtime/ftplugin/zig.vim @@ -41,16 +41,13 @@ let &l:define='\v(|||^\s*\#\s*define)' " Safety check: don't execute zig from current directory if !exists('g:zig_std_dir') && exists('*json_decode') && - \ executable('zig') && get(g:, 'zig_exec', get(g:, 'plugin_exec', 0)) - \ && (fnamemodify(exepath("zig"), ":p:h") != s:tmp_cwd - \ || (index(split($PATH,has("win32")? ';' : ':'), s:tmp_cwd) != -1 && s:tmp_cwd != '.')) + \ executable('zig') && dist#vim#IsSafeExecutable('zig', 'zig') silent let s:env = system('zig env') if v:shell_error == 0 let g:zig_std_dir = json_decode(s:env)['std_dir'] endif unlet! s:env endif -unlet! s:tmp_cwd if exists('g:zig_std_dir') let &l:path = g:zig_std_dir . ',' . &l:path -- cgit From ae8ca79920a8d0e928ac1502a10d1d063a06cae5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 9 Nov 2023 18:19:15 +0100 Subject: vim-patch:d56f15caf602 runtime(wget): Update for Wget2 2.1.0 (vim/vim#13497) https://github.com/vim/vim/commit/d56f15caf602a061f5f9f0a3c6a4537ab2dc6acc Co-authored-by: dkearns --- runtime/ftplugin/wget.vim | 4 ++-- runtime/ftplugin/wget2.vim | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/wget.vim b/runtime/ftplugin/wget.vim index 7a10221824..db3b62191e 100644 --- a/runtime/ftplugin/wget.vim +++ b/runtime/ftplugin/wget.vim @@ -1,5 +1,5 @@ " Vim filetype plugin file -" Language: Wget configuration file (/etc/wgetrc ~/.wgetrc) +" Language: Wget configuration file (/etc/wgetrc ~/.wgetrc) " Maintainer: Doug Kearns " Last Change: 2022 Apr 28 @@ -18,7 +18,7 @@ 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" . + let b:browsefilter = "Wget Configuration File (wgetrc, .wgetrc)\twgetrc;.wgetrc\n" .. \ "All Files (*.*)\t*.*\n" let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif diff --git a/runtime/ftplugin/wget2.vim b/runtime/ftplugin/wget2.vim index a6845f6df5..8cfcd514e5 100644 --- a/runtime/ftplugin/wget2.vim +++ b/runtime/ftplugin/wget2.vim @@ -1,5 +1,5 @@ " Vim filetype plugin file -" Language: Wget2 configuration file (/etc/wget2rc ~/.wget2rc) +" Language: Wget2 configuration file (/etc/wget2rc ~/.wget2rc) " Maintainer: Doug Kearns " Last Change: 2022 Apr 28 @@ -18,7 +18,7 @@ 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" . + let b:browsefilter = "Wget2 Configuration File (wget2rc, .wget2rc)\twget2rc;.wget2rc\n" .. \ "All Files (*.*)\t*.*\n" let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif -- cgit From c23dd7c9eff035d92830bb33eb9644d946a65d92 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Sun, 12 Nov 2023 01:51:25 +0200 Subject: vim-patch:9.0.2098: No filetype support for xcompose files (#25983) Problem: No filetype support for xcompose files Solution: Add filetype detection closes: vim/vim#13508 https://github.com/vim/vim/commit/4f9074b96cc7efb1c829ca74902a851551dcf4e8 --- runtime/ftplugin/xcompose.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 runtime/ftplugin/xcompose.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/xcompose.vim b/runtime/ftplugin/xcompose.vim new file mode 100644 index 0000000000..7345c27a2e --- /dev/null +++ b/runtime/ftplugin/xcompose.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin file +" Language: XCompose +" Maintainer: ObserverOfTime Date: Sun, 12 Nov 2023 10:33:34 +0100 Subject: vim-patch:2c133f6c1a16 runtime(lynx): Update for Lynx 2.8.9 (vim/vim#13510) https://github.com/vim/vim/commit/2c133f6c1a165a74678a89722ed8c42967c295e4 Co-authored-by: dkearns --- runtime/ftplugin/lynx.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/lynx.vim b/runtime/ftplugin/lynx.vim index b76c69f0ae..bf8410d6a0 100644 --- a/runtime/ftplugin/lynx.vim +++ b/runtime/ftplugin/lynx.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Lynx Web Browser Configuration " Maintainer: Doug Kearns -" Last Change: 2022 Sep 09 +" Last Change: 2023 Nov 09 if exists("b:did_ftplugin") finish @@ -18,7 +18,7 @@ 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" .. + 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 -- cgit From 9e2248ab586c5e5854da68b5310755ea3557e6c9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 14 Nov 2023 17:38:46 +0100 Subject: vim-patch:9.0.2104: wast filetype should be replaced by wat filetype Problem: wast filetype should be replaced by wat filetype Solution: start using the official wat filetype name runtime: rename `wast` filetype to `wat` (Wasm text format) The problem is the name of the current filetype wast. When the plugin was initially created, the file extension for Wasm text format was not fixed and .wast was more popular. However, recently .wat became the official file extension for WebAssembly text (WAT) format and .wast is now a file extension for the unofficial WAST format, which is a superset of .wat for the convenience to describe the Wasm specification conformance tests. https://webassembly.js.org/docs/contrib-wat-vs-wast.html However for now, let's keep using the `wat` filetype even for the .wast extension, so that we at least do not lose the filetype settings and syntax highlighting. This can be adjusted later, if it turns out to have a separate need for. closes: vim/vim#13533 https://github.com/vim/vim/commit/bc8f79d36a456054ed29f46585830af6d71f57c8 Co-authored-by: rhysd --- runtime/ftplugin/wast.vim | 17 ----------------- runtime/ftplugin/wat.vim | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 runtime/ftplugin/wast.vim create mode 100644 runtime/ftplugin/wat.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/wast.vim b/runtime/ftplugin/wast.vim deleted file mode 100644 index 0d9e98d37a..0000000000 --- a/runtime/ftplugin/wast.vim +++ /dev/null @@ -1,17 +0,0 @@ -" Vim filetype plugin file -" Language: WebAssembly -" Maintainer: rhysd -" Last Change: Jul 29, 2018 -" For bugs, patches and license go to https://github.com/rhysd/vim-wasm - -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 - -setlocal comments=s:(;,e:;),:;; -setlocal commentstring=(;%s;) -setlocal formatoptions-=t -setlocal iskeyword+=$,.,/ - -let b:undo_ftplugin = "setlocal comments< commentstring< formatoptions< iskeyword<" diff --git a/runtime/ftplugin/wat.vim b/runtime/ftplugin/wat.vim new file mode 100644 index 0000000000..35d2d6a322 --- /dev/null +++ b/runtime/ftplugin/wat.vim @@ -0,0 +1,17 @@ +" Vim filetype plugin file +" Language: WebAssembly +" Maintainer: rhysd +" Last Change: Nov 14, 2023 +" For bugs, patches and license go to https://github.com/rhysd/vim-wasm + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=s:(;,e:;),:;; +setlocal commentstring=(;%s;) +setlocal formatoptions-=t +setlocal iskeyword+=$,.,/ + +let b:undo_ftplugin = "setlocal comments< commentstring< formatoptions< iskeyword<" -- cgit From 38e98754a556404b54d3c28b4272bcacbc3b6b0e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 25 Nov 2023 16:06:58 +0100 Subject: vim-patch:9.0.2128: runtime(swig): add syntax and filetype plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add syntax and filetype plugins for SWIG (Simplified Wrapper Interface Generator) description files. The default syntax for .i files highlights comments in a reverse color scheme which doesn't look well. This syntax builds on vim's c++ syntax by adding highlighting for common swig directives and user defined directives. For an alternative syntax, see vimscript vim/vim#1247 (which I found after writing this). closes: vim/vim#13562 https://github.com/vim/vim/commit/2e31065a650015892179e520038bf2083a9519b6 Co-authored-by: Julien Marrec Co-authored-by: Matěj Cepl --- runtime/ftplugin/swig.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 runtime/ftplugin/swig.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/swig.vim b/runtime/ftplugin/swig.vim new file mode 100644 index 0000000000..506c929a43 --- /dev/null +++ b/runtime/ftplugin/swig.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin file +" Language: SWIG +" Maintainer: Julien Marrec +" Last Change: 2023 November 23 + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setlocal iskeyword<" +setlocal iskeyword+=% -- cgit