diff options
Diffstat (limited to 'runtime/ftplugin')
146 files changed, 1114 insertions, 422 deletions
diff --git a/runtime/ftplugin/abaqus.vim b/runtime/ftplugin/abaqus.vim index c16e7b032e..d4bb6fe777 100644 --- a/runtime/ftplugin/abaqus.vim +++ b/runtime/ftplugin/abaqus.vim @@ -3,6 +3,7 @@ " Maintainer: Carl Osterwisch <costerwi@gmail.com> " Last Change: 2022 Oct 08 " 2024 Jan 14 by Vim Project (browsefilter) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Only do this when not done yet for this buffer if exists("b:did_ftplugin") | finish | endif @@ -27,7 +28,7 @@ setlocal isfname-=, " Define format of comment lines (see 'formatoptions' for uses) setlocal comments=:** -setlocal commentstring=**%s +setlocal commentstring=**\ %s " Definitions start with a * and assign a NAME, NSET, or ELSET " Used in [d ^wd and other commands diff --git a/runtime/ftplugin/antlr4.vim b/runtime/ftplugin/antlr4.vim new file mode 100644 index 0000000000..610d5284fb --- /dev/null +++ b/runtime/ftplugin/antlr4.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: ANTLR4, ANother Tool for Language Recognition v4 <www.antlr.org> +" Maintainer: Yinzuo Jiang <jiangyinzuo@foxmail.com> +" Last Change: 2024 July 09 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// +setlocal commentstring=//\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/arduino.lua b/runtime/ftplugin/arduino.lua new file mode 100644 index 0000000000..89ab42ef54 --- /dev/null +++ b/runtime/ftplugin/arduino.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/arduino.vim b/runtime/ftplugin/arduino.vim index dae3dd83d3..60b11dab1a 100644 --- a/runtime/ftplugin/arduino.vim +++ b/runtime/ftplugin/arduino.vim @@ -3,6 +3,7 @@ " Maintainer: The Vim Project <https://github.com/vim/vim> " Ken Takata <https://github.com/k-takata> " Last Change: 2024 Apr 12 +" 2024 Jun 02 by Riley Bruins <ribru17@gmail.com> ('commentstring') " " Most of the part was copied from c.vim. @@ -32,7 +33,7 @@ setlocal fo-=t fo+=croql " These options have the right value as default, but the user may have " overruled that. -setlocal commentstring& define& include& +setlocal commentstring=/*\ %s\ */ define& include& " Set completion with CTRL-X CTRL-O to autoloaded function. if exists('&ofu') diff --git a/runtime/ftplugin/asm.vim b/runtime/ftplugin/asm.vim index 0ae1610394..4482b90d0b 100644 --- a/runtime/ftplugin/asm.vim +++ b/runtime/ftplugin/asm.vim @@ -4,13 +4,14 @@ " Last Change: 2020 May 23 " 2023 Aug 28 by Vim Project (undo_ftplugin) " 2024 Apr 09 by Vim Project (add Matchit support) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 setl include=^\\s*%\\s*include setl comments=:;,s1:/*,mb:*,ex:*/,:// -setl commentstring=;%s +setl commentstring=;\ %s let b:undo_ftplugin = "setl commentstring< comments< include<" diff --git a/runtime/ftplugin/astro.vim b/runtime/ftplugin/astro.vim index 0b0e03447b..5d35ba9624 100644 --- a/runtime/ftplugin/astro.vim +++ b/runtime/ftplugin/astro.vim @@ -2,6 +2,7 @@ " Language: Astro " Maintainer: Romain Lafourcade <romainlafourcade@gmail.com> " Last Change: 2024 Apr 21 +" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -25,17 +26,17 @@ function! s:AstroComments() abort \ || s:IdentifyScope('^\s*<script', '^\s*<\/script>') " ECMAScript comments setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// - setlocal commentstring=//%s + setlocal commentstring=//\ %s elseif s:IdentifyScope('^\s*<style', '^\s*<\/style>') " CSS comments setlocal comments=s1:/*,mb:*,ex:*/ - setlocal commentstring=/*%s*/ + setlocal commentstring=/*\ %s\ */ else " HTML comments setlocal comments=s:<!--,m:\ \ \ \ ,e:--> - setlocal commentstring=<!--%s--> + setlocal commentstring=<!--\ %s\ --> endif endfunction diff --git a/runtime/ftplugin/asy.vim b/runtime/ftplugin/asy.vim new file mode 100644 index 0000000000..76bd69d202 --- /dev/null +++ b/runtime/ftplugin/asy.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: Asymptote +" Maintainer: AvidSeeker <avidseeker7@protonmail.com> +" Last Change: 2024 Jul 13 +" + +if exists("b:did_ftplugin") + finish +endif +let g:did_ftplugin = 1 + +setlocal commentstring=/*\ %s\ */ + +let b:undo_ftplugin = "setl commentstring<" diff --git a/runtime/ftplugin/autohotkey.vim b/runtime/ftplugin/autohotkey.vim new file mode 100644 index 0000000000..9cb4fd7fdf --- /dev/null +++ b/runtime/ftplugin/autohotkey.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: AutoHotkey +" Maintainer: Peter Aronoff <peteraronoff@fastmail.com> +" Last Changed: 2024 Jul 25 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:; +setlocal commentstring=;\ %s + +let b:undo_ftplugin = "setlocal comments< commentstring<" + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/runtime/ftplugin/bindzone.vim b/runtime/ftplugin/bindzone.vim new file mode 100644 index 0000000000..f9e5f4ba3c --- /dev/null +++ b/runtime/ftplugin/bindzone.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: bind zone file +" Maintainer: This runtime file is looking for a new maintainer. +" Last Change: 2024 Jul 06 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin=1 + +setlocal comments=b:; +setlocal commentstring=;\ %s +setlocal formatoptions-=t +setlocal formatoptions+=crq + +let b:undo_ftplugin = "setlocal com< cms< fo<" diff --git a/runtime/ftplugin/bitbake.vim b/runtime/ftplugin/bitbake.vim index 99fe334627..4d50a7feb7 100644 --- a/runtime/ftplugin/bitbake.vim +++ b/runtime/ftplugin/bitbake.vim @@ -3,13 +3,14 @@ " Maintainer: Gregory Anders <greg@gpanders.com> " Repository: https://github.com/openembedded/bitbake " Latest Revision: 2022-07-23 +" 2024-05-23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 -setlocal commentstring=#%s +setlocal commentstring=#\ %s setlocal comments=:# setlocal suffixesadd=.bb,.bbclass diff --git a/runtime/ftplugin/c.lua b/runtime/ftplugin/c.lua index 0ddbf09470..09e286201b 100644 --- a/runtime/ftplugin/c.lua +++ b/runtime/ftplugin/c.lua @@ -1,5 +1,5 @@ -- These are the default option values in Vim, but not in Nvim, so must be set explicitly. -vim.bo.commentstring = '/*%s*/' +vim.bo.commentstring = '// %s' vim.bo.define = '^\\s*#\\s*define' vim.bo.include = '^\\s*#\\s*include' @@ -11,4 +11,4 @@ if vim.fn.isdirectory('/usr/include') == 1 then ]]) end -vim.b.undo_ftplugin = vim.b.undo_ftplugin .. '|setl path<' +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring< define< include< path<' diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index 716b454675..8b2b784eb4 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -2,6 +2,7 @@ " Language: C " Maintainer: The Vim Project <https://github.com/vim/vim> " Last Change: 2023 Aug 22 +" 2024 Jun 02 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Former Maintainer: Bram Moolenaar <Bram@vim.org> " Only do this when not done yet for this buffer @@ -24,7 +25,7 @@ setlocal fo-=t fo+=croql " These options have the right value as default, but the user may have " overruled that. -setlocal commentstring& define& include& +setlocal commentstring=/*\ %s\ */ define& include& " Set completion with CTRL-X CTRL-O to autoloaded function. if exists('&ofu') diff --git a/runtime/ftplugin/cabal.vim b/runtime/ftplugin/cabal.vim new file mode 100644 index 0000000000..5ccfa1df70 --- /dev/null +++ b/runtime/ftplugin/cabal.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin file +" Language: Haskell Cabal Build file +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 06 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:-- commentstring=--\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/calendar.vim b/runtime/ftplugin/calendar.vim index f454ba1dc8..c4e683acf6 100644 --- a/runtime/ftplugin/calendar.vim +++ b/runtime/ftplugin/calendar.vim @@ -2,6 +2,7 @@ " Language: calendar(1) input file " Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Latest Revision: 2008-07-09 +" 2024-06-02 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -13,7 +14,7 @@ set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" -setlocal comments=s1:/*,mb:*,ex:*/ commentstring& include& +setlocal comments=s1:/*,mb:*,ex:*/ commentstring=/*\ %s\ */ include& setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save diff --git a/runtime/ftplugin/calender.lua b/runtime/ftplugin/calender.lua deleted file mode 100644 index b4e68148f5..0000000000 --- a/runtime/ftplugin/calender.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.commentstring = '/*%s*/' diff --git a/runtime/ftplugin/cedar.vim b/runtime/ftplugin/cedar.vim new file mode 100644 index 0000000000..74a1903b46 --- /dev/null +++ b/runtime/ftplugin/cedar.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: Cedar +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 4 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:// commentstring=//\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/cgdbrc.vim b/runtime/ftplugin/cgdbrc.vim index 46cf135c5c..99f9702d26 100644 --- a/runtime/ftplugin/cgdbrc.vim +++ b/runtime/ftplugin/cgdbrc.vim @@ -3,6 +3,7 @@ " Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> " Documentation: https://cgdb.github.io/docs/Configuring-CGDB.html " Latest Revision: 2024-04-09 +" 2024-05-23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists('b:did_ftplugin') finish @@ -14,7 +15,7 @@ set cpoptions&vim let b:undo_ftplugin = 'setl com< cms<' -setlocal commentstring=#%s +setlocal commentstring=#\ %s setlocal comments=:# let &cpoptions = s:save_cpoptions diff --git a/runtime/ftplugin/ch.lua b/runtime/ftplugin/ch.lua new file mode 100644 index 0000000000..89ab42ef54 --- /dev/null +++ b/runtime/ftplugin/ch.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/chicken.vim b/runtime/ftplugin/chicken.vim index 84d45bae1e..b12b264f6e 100644 --- a/runtime/ftplugin/chicken.vim +++ b/runtime/ftplugin/chicken.vim @@ -1,12 +1,12 @@ " CHICKEN-specific Vim customizations -" Last Change: 2018-03-05 -" Author: Evan Hanson <evhan@foldling.org> -" Maintainer: Evan Hanson <evhan@foldling.org> -" Repository: https://git.foldling.org/vim-scheme.git -" URL: https://foldling.org/vim/ftplugin/chicken.vim -" Notes: These are supplemental settings, to be loaded after the core -" Scheme ftplugin file (ftplugin/scheme.vim). Enable it by setting -" b:is_chicken=1 and filetype=scheme. +" Last Change: 2024 Jun 21 +" Author: Evan Hanson <evhan@foldling.org> +" Maintainer: Evan Hanson <evhan@foldling.org> +" Repository: https://git.foldling.org/vim-scheme.git +" URL: https://foldling.org/vim/ftplugin/chicken.vim +" Notes: These are supplemental settings, to be loaded after the +" core Scheme ftplugin file (ftplugin/scheme.vim). Enable +" it by setting b:is_chicken=1 and filetype=scheme. if !exists('b:did_scheme_ftplugin') finish diff --git a/runtime/ftplugin/cmakecache.vim b/runtime/ftplugin/cmakecache.vim new file mode 100644 index 0000000000..6753cd284a --- /dev/null +++ b/runtime/ftplugin/cmakecache.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: cmakecache - CMakeCache.txt files generated by CMake +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 06 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:#,:// commentstring=//\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/context.vim b/runtime/ftplugin/context.vim index 37f7240d7b..ed6b5fa672 100644 --- a/runtime/ftplugin/context.vim +++ b/runtime/ftplugin/context.vim @@ -12,10 +12,6 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -if !exists('current_compiler') - compiler context -endif - let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo< ofu<" setlocal comments=b:%D,b:%C,b:%M,:% commentstring=%\ %s formatoptions+=tjcroql2 @@ -108,6 +104,12 @@ if get(g:, 'context_mappings', 1) endif endif +if !exists('current_compiler') + let b:undo_ftplugin ..= "| compiler make" + compiler context +endif + +let b:undo_ftplugin ..= "| sil! delc -buffer ConTeXt | sil! delc -buffer ConTeXtLog | sil! delc -buffer ConTeXtJobStatus | sil! delc -buffer ConTeXtStopJobs" " Commands for asynchronous typesetting command! -buffer -nargs=? -complete=file ConTeXt call context#typeset(<q-args>) command! -nargs=0 ConTeXtJobStatus call context#job_status() diff --git a/runtime/ftplugin/cpp.vim b/runtime/ftplugin/cpp.vim index d4931a2533..73768bc592 100644 --- a/runtime/ftplugin/cpp.vim +++ b/runtime/ftplugin/cpp.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: C++ " Maintainer: The Vim Project <https://github.com/vim/vim> -" Last Change: 2023 Aug 10 +" Last Change: 2024 Jun 06 " Former Maintainer: Bram Moolenaar <Bram@vim.org> " Only do this when not done yet for this buffer @@ -10,7 +10,12 @@ if exists("b:did_ftplugin") endif " Behaves mostly just like C -runtime! ftplugin/c.{vim,lua} ftplugin/c_*.{vim,lua} ftplugin/c/*.{vim,lua} +" XXX: "[.]" in the first pattern makes it a wildcard on Windows +runtime! ftplugin/c[.]{vim,lua} ftplugin/c_*.{vim,lua} ftplugin/c/*.{vim,lua} + +" Change 'commentstring' to "C++ style"/"mono-line" comments +setlocal commentstring=//\ %s +let b:undo_ftplugin ..= ' | setl commentstring<' " C++ uses templates with <things> " Disabled, because it gives an error for typing an unmatched ">". diff --git a/runtime/ftplugin/cs.lua b/runtime/ftplugin/cs.lua index b4e68148f5..89ab42ef54 100644 --- a/runtime/ftplugin/cs.lua +++ b/runtime/ftplugin/cs.lua @@ -1 +1,3 @@ -vim.bo.commentstring = '/*%s*/' +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/csh.vim b/runtime/ftplugin/csh.vim index a22bee3279..74666b9680 100644 --- a/runtime/ftplugin/csh.vim +++ b/runtime/ftplugin/csh.vim @@ -4,6 +4,7 @@ " Previous Maintainer: Dan Sharp " Contributor: Johannes Zellner <johannes@zellner.org> " Last Change: 2024 Jan 14 +" 2024 May 23 by Riley Bruins ('commentstring') if exists("b:did_ftplugin") finish @@ -14,7 +15,7 @@ let s:save_cpo = &cpo set cpo-=C setlocal comments=:# -setlocal commentstring=#%s +setlocal commentstring=#\ %s setlocal formatoptions-=t setlocal formatoptions+=crql diff --git a/runtime/ftplugin/css.lua b/runtime/ftplugin/css.lua deleted file mode 100644 index b4e68148f5..0000000000 --- a/runtime/ftplugin/css.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.commentstring = '/*%s*/' diff --git a/runtime/ftplugin/css.vim b/runtime/ftplugin/css.vim index ece2def4ee..778a9e12d6 100644 --- a/runtime/ftplugin/css.vim +++ b/runtime/ftplugin/css.vim @@ -3,6 +3,7 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Last Change: 2020 Dec 21 +" 2024 Jun 02 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -14,7 +15,7 @@ set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo< ofu< isk<" -setlocal comments=s1:/*,mb:*,ex:*/ commentstring& +setlocal comments=s1:/*,mb:*,ex:*/ commentstring=/*\ %s\ */ setlocal formatoptions-=t formatoptions+=croql setlocal omnifunc=csscomplete#CompleteCSS setlocal iskeyword+=- diff --git a/runtime/ftplugin/csv.vim b/runtime/ftplugin/csv.vim new file mode 100644 index 0000000000..60412ee527 --- /dev/null +++ b/runtime/ftplugin/csv.vim @@ -0,0 +1,22 @@ +" Maintainer: Maxim Kim <habamax@gmail.com> +" Converted from vim9script +" Last Update: 2024-06-18 + +if !exists("b:csv_delimiter") + " detect delimiter + let s:delimiters = ",;\t|" + + let s:max = 0 + for s:d in s:delimiters + let s:count = getline(1)->split(s:d)->len() + getline(2)->split(s:d)->len() + if s:count > s:max + let s:max = s:count + let b:csv_delimiter = s:d + endif + endfor +endif + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 diff --git a/runtime/ftplugin/cuda.vim b/runtime/ftplugin/cuda.vim new file mode 100644 index 0000000000..91d722b649 --- /dev/null +++ b/runtime/ftplugin/cuda.vim @@ -0,0 +1,11 @@ +" Vim filetype plugin +" Language: CUDA +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 29 + +if exists('b:did_ftplugin') + finish +endif + +" Behaves mostly just like C++ +runtime! ftplugin/cpp.vim diff --git a/runtime/ftplugin/d.lua b/runtime/ftplugin/d.lua index b4e68148f5..89ab42ef54 100644 --- a/runtime/ftplugin/d.lua +++ b/runtime/ftplugin/d.lua @@ -1 +1,3 @@ -vim.bo.commentstring = '/*%s*/' +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/deb822sources.vim b/runtime/ftplugin/deb822sources.vim index 4936f42bf9..31c81b1a5d 100644 --- a/runtime/ftplugin/deb822sources.vim +++ b/runtime/ftplugin/deb822sources.vim @@ -1,6 +1,6 @@ " Language: Debian sources.list " Maintainer: Debian Vim Maintainers <team+vim@tracker.debian.org> -" Last Change: 2024 Mar 20 +" Last Change: 2024 May 25 " License: Vim License " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/deb822sources.vim @@ -10,7 +10,7 @@ endif let b:did_ftplugin=1 setlocal comments=:# -setlocal commentstring=#%s +setlocal commentstring=#\ %s setlocal formatoptions-=t let b:undo_ftplugin = 'setlocal comments< commentstring< formatoptions<' diff --git a/runtime/ftplugin/debcontrol.vim b/runtime/ftplugin/debcontrol.vim index bb710e597c..5b8292ba6e 100644 --- a/runtime/ftplugin/debcontrol.vim +++ b/runtime/ftplugin/debcontrol.vim @@ -2,7 +2,7 @@ " Language: Debian control files " Maintainer: Debian Vim Maintainers " Former Maintainer: Pierre Habouzit <madcoder@debian.org> -" Last Change: 2023 Jan 16 +" Last Change: 2024 May 25 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/debcontrol.vim " Do these settings once per buffer @@ -19,8 +19,11 @@ if exists('g:debcontrol_fold_enable') endif setlocal textwidth=0 +setlocal comments=:# +setlocal commentstring=#\ %s + " Clean unloading -let b:undo_ftplugin = 'setlocal tw< foldmethod< foldexpr< foldtext<' +let b:undo_ftplugin = 'setlocal tw< foldmethod< foldexpr< foldtext< comments< commentstring<' " }}}1 diff --git a/runtime/ftplugin/debsources.vim b/runtime/ftplugin/debsources.vim index cbb4fafd22..2c5ea3599f 100644 --- a/runtime/ftplugin/debsources.vim +++ b/runtime/ftplugin/debsources.vim @@ -1,6 +1,6 @@ " Language: Debian sources.list " Maintainer: Debian Vim Maintainers <team+vim@tracker.debian.org> -" Last Change: 2023 Aug 30 +" Last Change: 2024 May 25 " License: Vim License " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/debsources.vim @@ -10,7 +10,7 @@ endif let b:did_ftplugin=1 setlocal comments=:# -setlocal commentstring=#%s +setlocal commentstring=#\ %s setlocal formatoptions-=t let b:undo_ftplugin = 'setlocal comments< commentstring< formatoptions<' diff --git a/runtime/ftplugin/desktop.vim b/runtime/ftplugin/desktop.vim index bd6fd7097c..d15afd24b9 100644 --- a/runtime/ftplugin/desktop.vim +++ b/runtime/ftplugin/desktop.vim @@ -2,6 +2,7 @@ " Language: XDG desktop entry " Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com ) " Last Change: 2022-07-26 +" 2024-05-24 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists('b:did_ftplugin') finish @@ -9,5 +10,5 @@ endif let b:did_ftplugin = v:true setl comments=:# -setl commentstring=#%s +setl commentstring=#\ %s let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/dot.lua b/runtime/ftplugin/dot.lua new file mode 100644 index 0000000000..89ab42ef54 --- /dev/null +++ b/runtime/ftplugin/dot.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/dtd.vim b/runtime/ftplugin/dtd.vim index bea8c5c18a..f97014814b 100644 --- a/runtime/ftplugin/dtd.vim +++ b/runtime/ftplugin/dtd.vim @@ -6,6 +6,7 @@ " Former maintainer: Dan Sharp " Last Change: 2009 Jan 20 " 2024 Jan 14 by Vim Project (browsefilter) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 @@ -15,7 +16,7 @@ let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo-=C -setlocal commentstring=<!--%s--> +setlocal commentstring=<!--\ %s\ --> setlocal comments=s:<!--,m:\ \ \ \ \ ,e:--> setlocal formatoptions-=t diff --git a/runtime/ftplugin/dtrace.vim b/runtime/ftplugin/dtrace.vim index 9288097f7f..a276b310a3 100644 --- a/runtime/ftplugin/dtrace.vim +++ b/runtime/ftplugin/dtrace.vim @@ -1,6 +1,7 @@ " Language: D script as described in "Solaris Dynamic Tracing Guide", " http://docs.sun.com/app/docs/doc/817-6223 " Last Change: 2008/03/20 +" 2024/05/23 by Riley Bruins <ribru17@gmail.com ('commentstring') " Version: 1.2 " Maintainer: Nicolas Weber <nicolasweber@gmx.de> @@ -26,8 +27,8 @@ setlocal fo-=t fo+=croql setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/ " dtrace uses /* */ comments. Set this explicitly, just in case the user -" changed this (/*%s*/ is the default) -setlocal commentstring=/*%s*/ +" changed this (/*\ %s\ */ is the default) +setlocal commentstring=/*\ %s\ */ setlocal iskeyword+=@,$ diff --git a/runtime/ftplugin/dts.vim b/runtime/ftplugin/dts.vim index 42e38338b7..346ff94704 100644 --- a/runtime/ftplugin/dts.vim +++ b/runtime/ftplugin/dts.vim @@ -2,6 +2,7 @@ " Language: dts/dtsi (device tree files) " Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> " Latest Revision: 2024 Apr 12 +" 2024 Jun 02 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists('b:did_ftplugin') finish @@ -12,5 +13,5 @@ let b:undo_ftplugin = 'setl inc< cms< com<' setlocal include=^\\%(#include\\\|/include/\\) " same as C -setlocal commentstring& +setlocal commentstring=/*\ %s\ */ setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// diff --git a/runtime/ftplugin/editorconfig.vim b/runtime/ftplugin/editorconfig.vim new file mode 100644 index 0000000000..6d437351eb --- /dev/null +++ b/runtime/ftplugin/editorconfig.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: EditorConfig +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 06 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:#,:; commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/erlang.vim b/runtime/ftplugin/erlang.vim index 1cb57f4c85..5a3ab717d9 100644 --- a/runtime/ftplugin/erlang.vim +++ b/runtime/ftplugin/erlang.vim @@ -6,7 +6,8 @@ " Eduardo Lopez (http://github.com/tapichu) " Arvid Bjurklint (http://github.com/slarwise) " Paweł Zacharek (http://github.com/subc2) -" Last Update: 2023-Dec-20 +" Riley Bruins (http://github.com/ribru17) ('commentstring') +" Last Update: 2024 May 23 " License: Vim license " URL: https://github.com/vim-erlang/vim-erlang-runtime @@ -27,7 +28,7 @@ if get(g:, 'erlang_folding', 0) endif setlocal comments=:%%%,:%%,:% -setlocal commentstring=%%s +setlocal commentstring=%\ %s setlocal formatoptions+=ro diff --git a/runtime/ftplugin/eruby.vim b/runtime/ftplugin/eruby.vim index b5c4665d24..b3e074aa20 100644 --- a/runtime/ftplugin/eruby.vim +++ b/runtime/ftplugin/eruby.vim @@ -5,6 +5,7 @@ " Release Coordinator: Doug Kearns <dougkearns@gmail.com> " Last Change: 2022 May 15 " 2024 Jan 14 by Vim Project (browsefilter) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -125,7 +126,7 @@ if exists("loaded_matchit") endif " TODO: comments= -setlocal commentstring=<%#%s%> +setlocal commentstring=<%#\ %s\ %> let b:undo_ftplugin = "setl cms< " . \ " | unlet! b:browsefilter b:match_words | " . b:undo_ftplugin diff --git a/runtime/ftplugin/faust.lua b/runtime/ftplugin/faust.lua new file mode 100644 index 0000000000..89ab42ef54 --- /dev/null +++ b/runtime/ftplugin/faust.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/fennel.vim b/runtime/ftplugin/fennel.vim index 93cf366726..2a9623faff 100644 --- a/runtime/ftplugin/fennel.vim +++ b/runtime/ftplugin/fennel.vim @@ -2,13 +2,14 @@ " Language: Fennel " Maintainer: Gregory Anders <greg[NOSPAM]@gpanders.com> " Last Update: 2023 Jun 9 +" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 -setlocal commentstring=;%s +setlocal commentstring=;\ %s setlocal comments=:;;,:; setlocal formatoptions-=t setlocal suffixesadd=.fnl diff --git a/runtime/ftplugin/fish.vim b/runtime/ftplugin/fish.vim index f06ad3a0bf..55d7ea8dd9 100644 --- a/runtime/ftplugin/fish.vim +++ b/runtime/ftplugin/fish.vim @@ -4,6 +4,7 @@ " Repository: https://github.com/nickeb96/fish.vim " Last Change: February 1, 2023 " 2023 Aug 28 by Vim Project (undo_ftplugin) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -12,7 +13,7 @@ let b:did_ftplugin = 1 setlocal iskeyword=@,48-57,_,192-255,-,. setlocal comments=:# -setlocal commentstring=#%s +setlocal commentstring=#\ %s setlocal formatoptions+=crjq let b:undo_ftplugin = "setl cms< com< fo< isk<" diff --git a/runtime/ftplugin/fortran.vim b/runtime/ftplugin/fortran.vim index 3c325818d3..19a4c1e62b 100644 --- a/runtime/ftplugin/fortran.vim +++ b/runtime/ftplugin/fortran.vim @@ -11,6 +11,7 @@ " Doug Kearns, and Fritz Reese. " Last Change: 2023 Dec 22 " 2024 Jan 14 by Vim Project (browsefilter) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Only do these settings when not done yet for this buffer if exists("b:did_ftplugin") @@ -89,7 +90,7 @@ else endif " Set commentstring for foldmethod=marker -setlocal cms=!%s +setlocal cms=!\ %s " Tabs are not a good idea in Fortran so the default is to expand tabs if !exists("fortran_have_tabs") diff --git a/runtime/ftplugin/fstab.vim b/runtime/ftplugin/fstab.vim index 99805322cd..0e7ffda498 100644 --- a/runtime/ftplugin/fstab.vim +++ b/runtime/ftplugin/fstab.vim @@ -3,6 +3,7 @@ " Maintainer: Radu Dineiu <radu.dineiu@gmail.com> " URL: https://raw.github.com/rid9/vim-fstab/master/ftplugin/fstab.vim " Last Change: 2021 Jan 02 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Version: 1.0 " " Credits: @@ -13,7 +14,7 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 -setlocal commentstring=#%s +setlocal commentstring=#\ %s let b:undo_ftplugin = "setlocal commentstring<" " vim: ts=8 ft=vim diff --git a/runtime/ftplugin/gdb.vim b/runtime/ftplugin/gdb.vim index 7c10633be4..af88a04d54 100644 --- a/runtime/ftplugin/gdb.vim +++ b/runtime/ftplugin/gdb.vim @@ -3,11 +3,12 @@ " Maintainer: Michaël Peeters <NOSPAMm.vim@noekeon.org> " Last Changed: 2017-10-26 " 2024-04-10: - add Matchit support (by Vim Project) +" 2024-04-23: - add space to commentstring (by Riley Bruins) ('commentstring') if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 -setlocal commentstring=#%s +setlocal commentstring=#\ %s setlocal include=^\\s*source " Undo the stuff we changed. diff --git a/runtime/ftplugin/gdscript.vim b/runtime/ftplugin/gdscript.vim index 692afdd0ea..8869c9a019 100644 --- a/runtime/ftplugin/gdscript.vim +++ b/runtime/ftplugin/gdscript.vim @@ -25,6 +25,11 @@ setlocal commentstring=#\ %s setlocal foldignore= setlocal foldexpr=s:GDScriptFoldLevel() +if get(g:, 'gdscript_recommended_style', 1) + setlocal noexpandtab tabstop=4 softtabstop=0 shiftwidth=0 + let b:undo_ftplugin ..= ' | setlocal expandtab< tabstop< softtabstop< shiftwidth<' +endif + function s:GDScriptFoldLevel() abort let line = getline(v:lnum) diff --git a/runtime/ftplugin/glsl.lua b/runtime/ftplugin/glsl.lua new file mode 100644 index 0000000000..89ab42ef54 --- /dev/null +++ b/runtime/ftplugin/glsl.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/go.vim b/runtime/ftplugin/go.vim index 61dc1a13b7..75f78cfa4b 100644 --- a/runtime/ftplugin/go.vim +++ b/runtime/ftplugin/go.vim @@ -2,6 +2,7 @@ " Language: Go " Maintainer: David Barnett (https://github.com/google/vim-ft-go) " Last Change: 2014 Aug 16 +" 2024 Jul 16 by Vim Project (add recommended indent style) if exists('b:did_ftplugin') finish @@ -15,4 +16,9 @@ setlocal commentstring=//\ %s let b:undo_ftplugin = 'setl fo< com< cms<' +if get(g:, 'go_recommended_style', 1) + setlocal noexpandtab softtabstop=0 shiftwidth=0 + let b:undo_ftplugin ..= ' | setl et< sts< sw<' +endif + " vim: sw=2 sts=2 et diff --git a/runtime/ftplugin/goaccess.vim b/runtime/ftplugin/goaccess.vim new file mode 100644 index 0000000000..fb557300c9 --- /dev/null +++ b/runtime/ftplugin/goaccess.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: GoAccess configuration +" Maintainer: Adam Monsen <haircut@gmail.com> +" Last Change: 2024 Aug 1 + +if exists('b:did_ftplugin') + finish +endif + +let b:did_ftplugin = 1 + +setl comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/gomod.vim b/runtime/ftplugin/gomod.vim new file mode 100644 index 0000000000..554c948eb0 --- /dev/null +++ b/runtime/ftplugin/gomod.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: go module file +" Maintainer: YU YUK KUEN <yukkuen.yu719@gmail.com> +" Last Change: 2024-06-21 +" 2024 Jul 16 by Vim Project (noexpandtab) + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal noexpandtab +setlocal formatoptions-=t formatoptions-=c +setlocal commentstring=//\ %s + +let b:undo_ftplugin = 'setl et< fo< cms<' diff --git a/runtime/ftplugin/gpg.vim b/runtime/ftplugin/gpg.vim index 7fb4f47ed8..bb4e0c9a19 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 <now@bitwi.se> -" Latest Revision: 2023-10-07 +" Latest Revision: 2024-09-19 (simplify keywordprg #15696) if exists("b:did_ftplugin") finish @@ -15,20 +15,12 @@ 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 GpgKeywordPrg - \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+--' . <q-args> . '\b'' --hilite-search" man ' . 'gpg' | - \ redraw! - elseif has('terminal') - command -buffer -nargs=1 GpgKeywordPrg - \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'gpg' - endif - if exists(':GpgKeywordPrg') == 2 - setlocal iskeyword+=- - setlocal keywordprg=:GpgKeywordPrg - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer GpgKeywordPrg' - endif +if has('unix') && executable('less') && exists(':terminal') == 2 + command -buffer -nargs=1 GpgKeywordPrg + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'gpg' + setlocal iskeyword+=- + setlocal keywordprg=:GpgKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer GpgKeywordPrg' endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/groovy.vim b/runtime/ftplugin/groovy.vim index cc7d6e35eb..a2e2b2f93e 100644 --- a/runtime/ftplugin/groovy.vim +++ b/runtime/ftplugin/groovy.vim @@ -2,6 +2,7 @@ " Language: groovy " Maintainer: Justin M. Keyes <justinkz@gmail.com> " Last Change: 2016 May 22 +" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists('b:did_ftplugin') finish @@ -13,7 +14,7 @@ set cpo-=C let b:undo_ftplugin = 'setlocal commentstring<' -setlocal commentstring=//%s +setlocal commentstring=//\ %s let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/hamster.vim b/runtime/ftplugin/hamster.vim index 5446e72286..904f267fdc 100644 --- a/runtime/ftplugin/hamster.vim +++ b/runtime/ftplugin/hamster.vim @@ -3,6 +3,7 @@ " Version: 2.0.6.0 " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> " Last Change: 2021 Jan 19 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -31,7 +32,7 @@ if &tw == 0 endif " Comments start with a double quote -setlocal commentstring=#%s +setlocal commentstring=#\ %s " Move around functions. noremap <silent><buffer> [[ :call search('^\s*sub\>', "bW")<CR> diff --git a/runtime/ftplugin/hare.vim b/runtime/ftplugin/hare.vim index 0200ba5913..6c61c818d1 100644 --- a/runtime/ftplugin/hare.vim +++ b/runtime/ftplugin/hare.vim @@ -1,35 +1,61 @@ -" Vim filetype plugin -" Language: Hare -" Maintainer: Amelia Clarke <me@rsaihe.dev> -" Previous Maintainer: Drew DeVault <sir@cmpwn.com> -" Last Updated: 2022-09-28 -" 2023 Aug 28 by Vim Project (undo_ftplugin) +" Vim filetype plugin. +" Language: Hare +" Maintainer: Amelia Clarke <selene@perilune.dev> +" Last Updated: 2024 Oct 04 +" Upstream: https://git.sr.ht/~sircmpwn/hare.vim if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 -" Formatting settings. -setlocal formatoptions-=t formatoptions+=croql/ +let s:cpo_save = &cpo +set cpo&vim -" Miscellaneous. +" Formatting settings. setlocal comments=:// setlocal commentstring=//\ %s +setlocal formatlistpat=^\ \\?-\ +setlocal formatoptions+=croqnlj/ formatoptions-=t + +" Search for Hare modules. +setlocal include=^\\s*use\\> +setlocal includeexpr=hare#FindModule(v:fname) +setlocal isfname+=: setlocal suffixesadd=.ha -let b:undo_ftplugin = "setl cms< com< fo< sua<" +" Add HAREPATH to the default search paths. +setlocal path-=/usr/include,, +let &l:path .= ',' .. hare#GetPath() .. ',,' + +let b:undo_ftplugin = 'setl cms< com< flp< fo< inc< inex< isf< pa< sua< mp<' -" Hare recommended style. -if get(g:, "hare_recommended_style", 1) +" Follow the Hare style guide by default. +if get(g:, 'hare_recommended_style', 1) setlocal noexpandtab - setlocal shiftwidth=8 + setlocal shiftwidth=0 setlocal softtabstop=0 setlocal tabstop=8 setlocal textwidth=80 - let b:undo_ftplugin ..= " | setl et< sts< sw< ts< tw<" + let b:undo_ftplugin .= ' et< sts< sw< ts< tw<' +endif + +augroup hare.vim + autocmd! + + " Highlight whitespace errors by default. + if get(g:, 'hare_space_error', 1) + autocmd InsertEnter * hi link hareSpaceError NONE + autocmd InsertLeave * hi link hareSpaceError Error + endif +augroup END + +if !exists('current_compiler') + let b:undo_ftplugin .= "| compiler make" + compiler hare endif -compiler hare +let &cpo = s:cpo_save +unlet s:cpo_save -" vim: et sw=2 sts=2 ts=8 +" vim: et sts=2 sw=2 ts=8 diff --git a/runtime/ftplugin/haredoc.vim b/runtime/ftplugin/haredoc.vim new file mode 100644 index 0000000000..69030b47ba --- /dev/null +++ b/runtime/ftplugin/haredoc.vim @@ -0,0 +1,44 @@ +" Vim filetype plugin. +" Language: Haredoc (Hare documentation format) +" Maintainer: Amelia Clarke <selene@perilune.dev> +" Last Updated: 2024-05-02 +" Upstream: https://git.sr.ht/~selene/hare.vim + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +" Formatting settings. +setlocal comments=:\ +setlocal formatlistpat=^\ \\?-\ +setlocal formatoptions+=tnlj formatoptions-=c formatoptions-=q + +" Search for Hare modules. +setlocal includeexpr=hare#FindModule(v:fname) +setlocal isfname+=: +setlocal suffixesadd=.ha + +" Add HAREPATH to the default search paths. +setlocal path-=/usr/include,, +let &l:path .= ',' .. hare#GetPath() .. ',,' + +let b:undo_ftplugin = 'setl com< flp< fo< inex< isf< pa< sua<' + +" Follow the Hare style guide by default. +if get(g:, 'hare_recommended_style', 1) + setlocal noexpandtab + setlocal shiftwidth=0 + setlocal softtabstop=0 + setlocal tabstop=8 + setlocal textwidth=80 + let b:undo_ftplugin .= ' et< sts< sw< ts< tw<' +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: et sts=2 sw=2 ts=8 diff --git a/runtime/ftplugin/hcl.vim b/runtime/ftplugin/hcl.vim new file mode 100644 index 0000000000..c47a0378d0 --- /dev/null +++ b/runtime/ftplugin/hcl.vim @@ -0,0 +1,10 @@ +" Vim filetype plugin +" Language: HCL +" Maintainer: Gregory Anders +" Last Change: 2024-09-03 + +if exists('b:did_ftplugin') + finish +endif + +runtime! ftplugin/terraform.vim diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua index 67c417b1be..8d991be0e4 100644 --- a/runtime/ftplugin/help.lua +++ b/runtime/ftplugin/help.lua @@ -1,7 +1,7 @@ -- use treesitter over syntax (for highlighted code blocks) vim.treesitter.start() --- add custom highlights for list in `:h highlight-groups` +-- Add custom highlights for list in `:h highlight-groups`. local bufname = vim.fs.normalize(vim.api.nvim_buf_get_name(0)) if vim.endswith(bufname, '/doc/syntax.txt') then require('vim.vimhelp').highlight_groups({ @@ -26,3 +26,10 @@ elseif vim.endswith(bufname, '/doc/lsp.txt') then { start = [[\*lsp-semantic-highlight\*]], stop = '^======', match = '^@[%w%p]+' }, }) end + +vim.keymap.set('n', 'gO', function() + require('vim.vimhelp').show_toc() +end, { buffer = 0, silent = true }) + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n exe "nunmap <buffer> gO"' +vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()' diff --git a/runtime/ftplugin/help.vim b/runtime/ftplugin/help.vim index a188e45cb4..833baf5d8f 100644 --- a/runtime/ftplugin/help.vim +++ b/runtime/ftplugin/help.vim @@ -21,77 +21,5 @@ endif " Prefer Vim help instead of manpages. setlocal keywordprg=:help -if !exists('g:no_plugin_maps') - function! s:show_toc() abort - let bufname = bufname('%') - let info = getloclist(0, {'winid': 1}) - if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname - lopen - return - endif - - let toc = [] - let lnum = 2 - let last_line = line('$') - 1 - let last_added = 0 - let has_section = 0 - let has_sub_section = 0 - - while lnum && lnum <= last_line - let level = 0 - let add_text = '' - let text = getline(lnum) - - if text =~# '^=\+$' && lnum + 1 < last_line - " A de-facto section heading. Other headings are inferred. - let has_section = 1 - let has_sub_section = 0 - let lnum = nextnonblank(lnum + 1) - let text = getline(lnum) - let add_text = text - while add_text =~# '\*[^*]\+\*\s*$' - let add_text = matchstr(add_text, '.*\ze\*[^*]\+\*\s*$') - endwhile - elseif text =~# '^[A-Z0-9][-A-ZA-Z0-9 .][-A-Z0-9 .():]*\%([ \t]\+\*.\+\*\)\?$' - " Any line that's yelling is important. - let has_sub_section = 1 - let level = has_section - let add_text = matchstr(text, '.\{-}\ze\s*\%([ \t]\+\*.\+\*\)\?$') - elseif text =~# '\~$' - \ && matchstr(text, '^\s*\zs.\{-}\ze\s*\~$') !~# '\t\|\s\{2,}' - \ && getline(lnum - 1) =~# '^\s*<\?$\|^\s*\*.*\*$' - \ && getline(lnum + 1) =~# '^\s*>\?$\|^\s*\*.*\*$' - " These lines could be headers or code examples. We only want the - " ones that have subsequent lines at the same indent or more. - let l = nextnonblank(lnum + 1) - if getline(l) =~# '\*[^*]\+\*$' - " Ignore tag lines - let l = nextnonblank(l + 1) - endif - - if indent(lnum) <= indent(l) - let level = has_section + has_sub_section - let add_text = matchstr(text, '\S.\{-}\ze\s\=\~$') - endif - endif - - let add_text = substitute(add_text, '\s\+$', '', 'g') - if !empty(add_text) && last_added != lnum - let last_added = lnum - call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum, - \ 'text': repeat("\u00a0\u00a0", level) . add_text}) - endif - let lnum = nextnonblank(lnum + 1) - endwhile - - call setloclist(0, toc, ' ') - call setloclist(0, [], 'a', {'title': 'Help TOC'}) - lopen - let w:qf_toc = bufname - endfunction - - nnoremap <silent><buffer> gO :call <sid>show_toc()<cr> -endif - let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/hlsplaylist.vim b/runtime/ftplugin/hlsplaylist.vim new file mode 100644 index 0000000000..879a04f0f9 --- /dev/null +++ b/runtime/ftplugin/hlsplaylist.vim @@ -0,0 +1,37 @@ +" Vim filetype plugin +" Language: HLS/M3U Playlist +" Maintainer: AvidSeeker <avidseeker7@protonmail.com> +" Last Change: 2024 Jul 07 +" + +if exists("b:did_ftplugin") + finish +endif +let g:did_ftplugin = 1 + +setlocal commentstring=#%s + +let b:undo_ftplugin = "setl commentstring<" + +function! M3UFold() abort + let line = getline(v:lnum) + if line =~# '^#EXTGRP' + return ">1" + endif + return "=" +endfunction + +function! M3UFoldText() abort + let start_line = getline(v:foldstart) + let title = substitute(start_line, '^#EXTGRP:*', '', '') + let foldsize = (v:foldend - v:foldstart + 1) + let linecount = '['.foldsize.' lines]' + return title.' '.linecount +endfunction + +if has("folding") + setlocal foldexpr=M3UFold() + setlocal foldmethod=expr + setlocal foldtext=M3UFoldText() + let b:undo_ftplugin .= "|setl foldexpr< foldmethod< foldtext<" +endif diff --git a/runtime/ftplugin/html.vim b/runtime/ftplugin/html.vim index 3aa60a873e..5495f859de 100644 --- a/runtime/ftplugin/html.vim +++ b/runtime/ftplugin/html.vim @@ -3,6 +3,7 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainer: Dan Sharp " Last Change: 2024 Jan 14 +" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -13,7 +14,7 @@ let s:save_cpo = &cpo set cpo-=C setlocal matchpairs+=<:> -setlocal commentstring=<!--%s--> +setlocal commentstring=<!--\ %s\ --> setlocal comments=s:<!--,m:\ \ \ \ ,e:--> let b:undo_ftplugin = "setlocal comments< commentstring< matchpairs<" diff --git a/runtime/ftplugin/htmlangular.vim b/runtime/ftplugin/htmlangular.vim new file mode 100644 index 0000000000..b114372442 --- /dev/null +++ b/runtime/ftplugin/htmlangular.vim @@ -0,0 +1,12 @@ +" Vim filetype plugin file +" Language: Angular HTML Template +" Maintainer: Dennis van den Berg <dennis@vdberg.dev> +" Last Change: 2024 Jul 9 + +" Only use this filetype plugin when no other was loaded. +if exists("b:did_ftplugin") + finish +endif + +" source the HTML ftplugin +runtime! ftplugin/html.vim diff --git a/runtime/ftplugin/http.vim b/runtime/ftplugin/http.vim new file mode 100644 index 0000000000..ca5055011b --- /dev/null +++ b/runtime/ftplugin/http.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: HTTP +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Sep 28 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/indent.lua b/runtime/ftplugin/indent.lua index b4e68148f5..89ab42ef54 100644 --- a/runtime/ftplugin/indent.lua +++ b/runtime/ftplugin/indent.lua @@ -1 +1,3 @@ -vim.bo.commentstring = '/*%s*/' +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/indent.vim b/runtime/ftplugin/indent.vim index 64a650ad7b..32208d38d8 100644 --- a/runtime/ftplugin/indent.vim +++ b/runtime/ftplugin/indent.vim @@ -3,6 +3,7 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Latest Revision: 2008-07-09 +" 2024-06-02 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -14,7 +15,7 @@ set cpo&vim let b:undo_ftplugin = "setl com< cms< fo<" -setlocal comments=s1:/*,mb:*,ex:*/ commentstring& +setlocal comments=s1:/*,mb:*,ex:*/ commentstring=/*\ %s\ */ setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save diff --git a/runtime/ftplugin/initex.vim b/runtime/ftplugin/initex.vim index 0ee3e8d899..71049df6bd 100644 --- a/runtime/ftplugin/initex.vim +++ b/runtime/ftplugin/initex.vim @@ -3,6 +3,7 @@ " Maintainer: Benji Fisher, Ph.D. <benji@member.AMS.org> " Version: 1.0 " Last Change: Wed 19 Apr 2006 +" Last Change: Thu 23 May 2024 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Only do this when not done yet for this buffer. if exists("b:did_ftplugin") @@ -23,7 +24,7 @@ setlocal com=sO:%\ -,mO:%\ \ ,eO:%%,:% " Set 'commentstring' to recognize the % comment character: " (Thanks to Ajit Thakkar.) -setlocal cms=%%s +setlocal cms=%\ %s " Allow "[d" to be used to find a macro definition: let &l:define='\\\([egx]\|char\|mathchar\|count\|dimen\|muskip\|skip\|toks\)\=' diff --git a/runtime/ftplugin/java.vim b/runtime/ftplugin/java.vim index fa2b61075f..55b358374f 100644 --- a/runtime/ftplugin/java.vim +++ b/runtime/ftplugin/java.vim @@ -3,17 +3,29 @@ " Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com> " Former Maintainer: Dan Sharp " Repository: https://github.com/zzzyxwvut/java-vim.git -" Last Change: 2024 Apr 18 +" Last Change: 2024 Sep 26 " 2024 Jan 14 by Vim Project (browsefilter) - -if exists("b:did_ftplugin") | finish | endif -let b:did_ftplugin = 1 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Make sure the continuation lines below do not cause problems in " compatibility mode. let s:save_cpo = &cpo set cpo-=C +if (exists("g:java_ignore_javadoc") || exists("g:java_ignore_markdown")) && + \ exists("*javaformat#RemoveCommonMarkdownWhitespace") + delfunction javaformat#RemoveCommonMarkdownWhitespace + unlet! g:loaded_javaformat +endif + +if exists("b:did_ftplugin") + let &cpo = s:save_cpo + unlet s:save_cpo + finish +endif + +let b:did_ftplugin = 1 + " For filename completion, prefer the .java extension over the .class " extension. set suffixes+=.class @@ -26,6 +38,8 @@ setlocal suffixesadd=.java " Clean up in case this file is sourced again. unlet! s:zip_func_upgradable +"""" STRIVE TO REMAIN COMPATIBLE FOR AT LEAST VIM 7.0. + " Documented in ":help ft-java-plugin". if exists("g:ftplugin_java_source_path") && \ type(g:ftplugin_java_source_path) == type("") @@ -58,10 +72,11 @@ endif " and insert the comment leader when hitting <CR> or using "o". setlocal formatoptions-=t formatoptions+=croql -" Set 'comments' to format dashed lists in comments. Behaves just like C. -setlocal comments& comments^=sO:*\ -,mO:*\ \ ,exO:*/ +" Set 'comments' to format Markdown Javadoc comments and dashed lists +" in other multi-line comments (it behaves just like C). +setlocal comments& comments^=:///,sO:*\ -,mO:*\ \ ,exO:*/ -setlocal commentstring=//%s +setlocal commentstring=//\ %s " Change the :browse e filter to primarily show Java-related files. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") @@ -102,3 +117,4 @@ endif " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo +" vim: fdm=syntax sw=4 ts=8 noet sta diff --git a/runtime/ftplugin/javacc.vim b/runtime/ftplugin/javacc.vim new file mode 100644 index 0000000000..780c68b0f9 --- /dev/null +++ b/runtime/ftplugin/javacc.vim @@ -0,0 +1,20 @@ +" Vim filetype plugin +" Language: JavaCC +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 06 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +" Set 'formatoptions' to break comment lines but not other lines, +" and insert the comment leader when hitting <CR> or using "o". +setlocal formatoptions-=t formatoptions+=croql + +" Set 'comments' to format dashed lists in comments. Behaves just like C. +setlocal comments& comments^=sO:*\ -,mO:*\ \ ,exO:*/ + +setlocal commentstring=//\ %s + +let b:undo_ftplugin = 'setl fo< com< cms<' diff --git a/runtime/ftplugin/javascript.vim b/runtime/ftplugin/javascript.vim index 2633954903..455b794cf0 100644 --- a/runtime/ftplugin/javascript.vim +++ b/runtime/ftplugin/javascript.vim @@ -3,6 +3,7 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " Contributor: Romain Lafourcade <romainlafourcade@gmail.com> " Last Change: 2024 Jan 14 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -24,7 +25,7 @@ endif " Set 'comments' to format dashed lists in comments. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// -setlocal commentstring=//%s +setlocal commentstring=//\ %s " Change the :browse e filter to primarily show JavaScript-related files. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") diff --git a/runtime/ftplugin/jq.vim b/runtime/ftplugin/jq.vim index 88958e80dd..307fbdb62d 100644 --- a/runtime/ftplugin/jq.vim +++ b/runtime/ftplugin/jq.vim @@ -2,6 +2,8 @@ " Language: jq " Maintainer: Vito <vito.blog@gmail.com> " Last Change: 2024 Apr 29 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') +" 2024 Oct 04 by Konfekt (unset compiler) " Upstream: https://github.com/vito-c/jq.vim if exists('b:did_ftplugin') @@ -10,7 +12,12 @@ endif let b:did_ftplugin = 1 setlocal include=^\\s*\\%(import\\\|include\\) -setlocal commentstring=#%s -compiler jq +setlocal commentstring=#\ %s let b:undo_ftplugin = 'setl commentstring< include<' + +if !exists('current_compiler') + let b:undo_ftplugin ..= "| compiler make" + compiler jq +endif + diff --git a/runtime/ftplugin/jsonc.vim b/runtime/ftplugin/jsonc.vim index e47a75f574..ec3268492c 100644 --- a/runtime/ftplugin/jsonc.vim +++ b/runtime/ftplugin/jsonc.vim @@ -5,6 +5,7 @@ " https://github.com/kevinoid/vim-jsonc " License: MIT " Last Change: 2021 Nov 22 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') runtime! ftplugin/json.vim @@ -15,7 +16,7 @@ else endif " Set comment (formatting) related options. {{{1 -setlocal commentstring=//%s comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// +setlocal commentstring=//\ %s comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// " Let Vim know how to disable the plug-in. let b:undo_ftplugin = 'setlocal commentstring< comments<' diff --git a/runtime/ftplugin/kdl.vim b/runtime/ftplugin/kdl.vim new file mode 100644 index 0000000000..c9a1d8b185 --- /dev/null +++ b/runtime/ftplugin/kdl.vim @@ -0,0 +1,17 @@ +" Vim filetype plugin +" Language: KDL +" Author: Aram Drevekenin <aram@poor.dev> +" Maintainer: Yinzuo Jiang <jiangyinzuo@foxmail.com> +" Last Change: 2024-06-10 + +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<' diff --git a/runtime/ftplugin/kivy.vim b/runtime/ftplugin/kivy.vim new file mode 100644 index 0000000000..e19d832bf3 --- /dev/null +++ b/runtime/ftplugin/kivy.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: Kivy +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 06 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl commentstring=#\ %s + +let b:undo_ftplugin = 'setl cms<' diff --git a/runtime/ftplugin/lc.vim b/runtime/ftplugin/lc.vim new file mode 100644 index 0000000000..e818f1aecb --- /dev/null +++ b/runtime/ftplugin/lc.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: Elsa +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 May 25 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:-- commentstring=--\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/ld.vim b/runtime/ftplugin/ld.vim index 1ab80d533c..9cc70bd94d 100644 --- a/runtime/ftplugin/ld.vim +++ b/runtime/ftplugin/ld.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: ld(1) script " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2008-07-09 +" Latest Revision: 2008 Jul 09 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -13,7 +14,7 @@ set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" -setlocal comments=s1:/*,mb:*,ex:*/ commentstring=/*%s*/ include=^\\s*INCLUDE +setlocal comments=s1:/*,mb:*,ex:*/ commentstring=/*\ %s\ */ include=^\\s*INCLUDE setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save diff --git a/runtime/ftplugin/ldapconf.vim b/runtime/ftplugin/ldapconf.vim new file mode 100644 index 0000000000..70557160e8 --- /dev/null +++ b/runtime/ftplugin/ldapconf.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: ldap.conf(5) configuration file. +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 06 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/lex.vim b/runtime/ftplugin/lex.vim new file mode 100644 index 0000000000..c6c47fedf0 --- /dev/null +++ b/runtime/ftplugin/lex.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: Lex and Flex +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 06 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// +setlocal commentstring=//\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/liquid.vim b/runtime/ftplugin/liquid.vim index f24ec4cbb2..dbd8abe457 100644 --- a/runtime/ftplugin/liquid.vim +++ b/runtime/ftplugin/liquid.vim @@ -2,6 +2,7 @@ " Language: Liquid " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Last Change: 2022 Mar 15 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists('b:did_ftplugin') finish @@ -56,6 +57,6 @@ if exists('loaded_matchit') let b:match_words .= '\<\%(if\w*\|unless\|case\)\>:\<\%(elsif\|else\|when\)\>:\<end\%(if\w*\|unless\|case\)\>,\<\%(for\|tablerow\)\>:\%({%\s*\)\@<=empty\>:\<end\%(for\|tablerow\)\>,\<\(capture\|comment\|highlight\)\>:\<end\1\>' endif -setlocal commentstring={%\ comment\ %}%s{%\ endcomment\ %} +setlocal commentstring={%\ comment\ %}\ %s\ {%\ endcomment\ %} let b:undo_ftplugin .= 'setl cms< | unlet! b:browsefilter b:match_words' diff --git a/runtime/ftplugin/lisp.vim b/runtime/ftplugin/lisp.vim index db3ac96631..fe3c6fe996 100644 --- a/runtime/ftplugin/lisp.vim +++ b/runtime/ftplugin/lisp.vim @@ -5,6 +5,7 @@ " Original author: Dorai Sitaram <ds26@gte.com> " Original URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html " Last Change: Mar 10, 2021 +" May 23, 2024 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -19,6 +20,6 @@ setl define=^\\s*(def\\k* setl formatoptions-=t setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 setl lisp -setl commentstring=;%s +setl commentstring=;\ %s let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp< commentstring<" diff --git a/runtime/ftplugin/lua.lua b/runtime/ftplugin/lua.lua index 98f218e36e..75deb6b190 100644 --- a/runtime/ftplugin/lua.lua +++ b/runtime/ftplugin/lua.lua @@ -1,2 +1,4 @@ -- use treesitter over syntax vim.treesitter.start() + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n call v:lua.vim.treesitter.stop()' diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index fdeaae4c3f..37667477f3 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -8,14 +8,16 @@ let b:did_ftplugin = 1 setlocal noexpandtab tabstop=8 softtabstop=8 shiftwidth=8 setlocal wrap breakindent linebreak +setlocal colorcolumn=0 nolist " Parentheses and '-' for references like `git-ls-files(1)`; '@' for systemd " pages; ':' for Perl and C++ pages. Here, I intentionally omit the locale " specific characters matched by `@`. setlocal iskeyword=@-@,:,a-z,A-Z,48-57,_,.,-,(,) -setlocal nonumber norelativenumber -setlocal foldcolumn=0 colorcolumn=0 nolist nofoldenable +" man page content is likely preformatted for the terminal width, so +" narrowing display by any additional columns leads to Embarrassing Line Wrap +setlocal nonumber norelativenumber foldcolumn=0 signcolumn=auto setlocal tagfunc=v:lua.require'man'.goto_tag @@ -35,6 +37,8 @@ if get(g:, 'ft_man_folding_enable', 0) setlocal foldenable setlocal foldmethod=indent setlocal foldnestmax=1 +else + setlocal nofoldenable endif let b:undo_ftplugin = '' diff --git a/runtime/ftplugin/markdown.vim b/runtime/ftplugin/markdown.vim index 022dd0d601..d4ee5ac242 100644 --- a/runtime/ftplugin/markdown.vim +++ b/runtime/ftplugin/markdown.vim @@ -2,6 +2,7 @@ " Language: Markdown " Maintainer: Tim Pope <https://github.com/tpope/vim-markdown> " Last Change: 2023 Dec 28 +" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -12,7 +13,7 @@ runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim let s:keepcpo= &cpo set cpo&vim -setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s--> +setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--\ %s\ --> setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\} diff --git a/runtime/ftplugin/mediawiki.vim b/runtime/ftplugin/mediawiki.vim new file mode 100644 index 0000000000..4618246106 --- /dev/null +++ b/runtime/ftplugin/mediawiki.vim @@ -0,0 +1,42 @@ +" Language: MediaWiki +" Maintainer: Avid Seeker <avidseeker7@protonmail.com> +" Home: http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#Vim +" Last Change: 2024 Jul 14 +" Credits: chikamichi +" + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +" Many MediaWiki wikis prefer line breaks only at the end of paragraphs +" (like in a text processor), which results in long, wrapping lines. +setlocal wrap linebreak +setlocal textwidth=0 + +setlocal formatoptions-=tc formatoptions+=l formatoptions+=roq +setlocal matchpairs+=<:> + +" Treat lists, indented text and tables as comment lines and continue with the +" same formatting in the next line (i.e. insert the comment leader) when hitting +" <CR> or using "o". +setlocal comments=n:#,n:*,n:\:,s:{\|,m:\|,ex:\|},s:<!--,m:\ \ \ \ ,e:--> +setlocal commentstring=<!--\ %s\ --> + +" match HTML tags (taken directly from $VIM/ftplugin/html.vim) +if exists("loaded_matchit") + let b:match_ignorecase=0 + let b:match_skip = 's:Comment' + let b:match_words = '<:>,' . + \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' . + \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' . + \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' +endif + +" Enable folding based on ==sections== +setlocal foldexpr=getline(v:lnum)=~'^\\(=\\+\\)[^=]\\+\\1\\(\\s*<!--.*-->\\)\\=\\s*$'?\">\".(len(matchstr(getline(v:lnum),'^=\\+'))-1):\"=\" +setlocal foldmethod=expr + +let b:undo_ftplugin = "setl commentstring< comments< formatoptions< foldexpr< foldmethod<" +let b:undo_ftplugin += " matchpairs< linebreak< wrap< textwidth<" diff --git a/runtime/ftplugin/mermaid.vim b/runtime/ftplugin/mermaid.vim index fe84ab37cf..5547ad3e1f 100644 --- a/runtime/ftplugin/mermaid.vim +++ b/runtime/ftplugin/mermaid.vim @@ -2,6 +2,7 @@ " Language: Mermaid " Maintainer: Craig MacEachern <https://github.com/craigmac/vim-mermaid> " Last Change: 2022 Oct 13 +" 2024 Jul 18 by Vim Project (adjust comments) if exists("b:did_ftplugin") finish @@ -16,9 +17,9 @@ setlocal shiftwidth=2 setlocal softtabstop=-1 setlocal tabstop=4 +setlocal comments=:%% +setlocal commentstring=%%\ %s " TODO: comments, formatlist stuff, based on what? -setlocal comments=b:#,fb:- -setlocal commentstring=#\ %s setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\} diff --git a/runtime/ftplugin/mma.vim b/runtime/ftplugin/mma.vim index ce4cee18ae..91a8111bcb 100644 --- a/runtime/ftplugin/mma.vim +++ b/runtime/ftplugin/mma.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: Mathematica " Maintainer: Ian Ford <ianf@wolfram.com> -" Last Change: 22 January 2019 +" Last Change: 2019 Jan 22 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -13,4 +14,4 @@ let b:did_ftplugin = 1 let b:undo_ftplugin = "setlocal commentstring<" -setlocal commentstring=\(*%s*\) +setlocal commentstring=\(*\ %s\ *\) diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim index 22d18a9aad..68ce69a446 100644 --- a/runtime/ftplugin/modconf.vim +++ b/runtime/ftplugin/modconf.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: modules.conf(5) configuration file +" Maintainer: This runtime file is looking for a new maintainer. " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2023-10-07 +" Latest Revision: 2024-09-20 (remove erroneous endif) if exists("b:did_ftplugin") finish @@ -16,20 +17,12 @@ 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 ModconfKeywordPrg - \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'modprobe.d' | - \ redraw! - elseif has('terminal') - command -buffer -nargs=1 ModconfKeywordPrg - \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d' - endif - if exists(':ModconfKeywordPrg') == 2 - setlocal iskeyword+=- - setlocal keywordprg=:ModconfKeywordPrg - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ModconfKeywordPrg' - endif +if has('unix') && executable('less') && exists(':terminal') == 2 + command -buffer -nargs=1 ModconfKeywordPrg + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d' + setlocal iskeyword+=- + setlocal keywordprg=:ModconfKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ModconfKeywordPrg' endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/modula2.vim b/runtime/ftplugin/modula2.vim index 9c1acc276a..306688da05 100644 --- a/runtime/ftplugin/modula2.vim +++ b/runtime/ftplugin/modula2.vim @@ -2,6 +2,7 @@ " Language: Modula-2 " Maintainer: Doug Kearns <dougkearns@gmail.com> " Last Change: 2024 Jan 14 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -17,7 +18,7 @@ if s:dialect ==# "r10" setlocal comments=s:(*,m:\ ,e:*),:! setlocal commentstring=!\ %s else - setlocal commentstring=(*%s*) + setlocal commentstring=(*\ %s\ *) setlocal comments=s:(*,m:\ ,e:*) endif setlocal formatoptions-=t formatoptions+=croql diff --git a/runtime/ftplugin/modula3.vim b/runtime/ftplugin/modula3.vim index 45dd7ca01c..f899d1d103 100644 --- a/runtime/ftplugin/modula3.vim +++ b/runtime/ftplugin/modula3.vim @@ -2,6 +2,7 @@ " Language: Modula-3 " Maintainer: Doug Kearns <dougkearns@gmail.com> " Last Change: 2024 Jan 14 +" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -12,7 +13,7 @@ let s:cpo_save = &cpo set cpo&vim setlocal comments=s0:(*,mb:\ ,ex:*) -setlocal commentstring=(*%s*) +setlocal commentstring=(*\ %s\ *) setlocal formatoptions-=t formatoptions+=croql setlocal suffixesadd+=.m3 setlocal formatprg=m3pp diff --git a/runtime/ftplugin/mojo.vim b/runtime/ftplugin/mojo.vim new file mode 100644 index 0000000000..ff50229934 --- /dev/null +++ b/runtime/ftplugin/mojo.vim @@ -0,0 +1,41 @@ +" Vim filetype plugin +" Language: Mojo +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 07 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal include=^\\s*\\(from\\\|import\\) +setlocal define=^\\s*\\(\\(async\\s\\+\\)\\?def\\\|class\\) + +" For imports with leading .., append / and replace additional .s with ../ +let b:grandparent_match = '^\(.\.\)\(\.*\)' +let b:grandparent_sub = '\=submatch(1)."/".repeat("../",strlen(submatch(2)))' + +" For imports with a single leading ., replace it with ./ +let b:parent_match = '^\.\(\.\)\@!' +let b:parent_sub = './' + +" Replace any . sandwiched between word characters with / +let b:child_match = '\(\w\)\.\(\w\)' +let b:child_sub = '\1/\2' + +setlocal includeexpr=substitute(substitute(substitute( + \v:fname, + \b:grandparent_match,b:grandparent_sub,''), + \b:parent_match,b:parent_sub,''), + \b:child_match,b:child_sub,'g') + +setlocal suffixesadd=.mojo +setlocal comments=b:#,fb:- +setlocal commentstring=#\ %s + +let b:undo_ftplugin = 'setlocal include<' + \ . '|setlocal define<' + \ . '|setlocal includeexpr<' + \ . '|setlocal suffixesadd<' + \ . '|setlocal comments<' + \ . '|setlocal commentstring<' diff --git a/runtime/ftplugin/muttrc.vim b/runtime/ftplugin/muttrc.vim index c9f6df31d0..7df61580bf 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 <now@bitwi.se> -" Latest Revision: 2023-10-07 +" Latest Revision: 2024-09-19 (simplify keywordprg #15696) if exists("b:did_ftplugin") finish @@ -18,20 +18,12 @@ setlocal formatoptions-=t formatoptions+=croql let &l:include = '^\s*source\>' -if has('unix') && executable('less') - if !has('gui_running') - command -buffer -nargs=1 MuttrcKeywordPrg - \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . 'muttrc' | - \ redraw! - elseif has('terminal') - command -buffer -nargs=1 MuttrcKeywordPrg - \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'muttrc' - endif - if exists(':MuttrcKeywordPrg') == 2 - setlocal iskeyword+=- - setlocal keywordprg=:MuttrcKeywordPrg - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer MuttrcKeywordPrg' - endif +if has('unix') && executable('less') && exists(':terminal') == 2 + command -buffer -nargs=1 MuttrcKeywordPrg + \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'muttrc' + setlocal iskeyword+=- + setlocal keywordprg=:MuttrcKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer MuttrcKeywordPrg' endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/mysql.vim b/runtime/ftplugin/mysql.vim new file mode 100644 index 0000000000..232df8c5a3 --- /dev/null +++ b/runtime/ftplugin/mysql.vim @@ -0,0 +1,9 @@ +" Vim filetype plugin +" Language: MySQL +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Aug 12 +if exists("b:did_ftplugin") + finish +endif + +runtime ftplugin/sql.vim diff --git a/runtime/ftplugin/nroff.vim b/runtime/ftplugin/nroff.vim index cf62d02daa..ed0b32f5f3 100644 --- a/runtime/ftplugin/nroff.vim +++ b/runtime/ftplugin/nroff.vim @@ -2,15 +2,15 @@ " Language: roff(7) " Maintainer: Aman Verma " Homepage: https://github.com/a-vrma/vim-nroff-ftplugin -" Previous Maintainer: Chris Spiegel <cspiegel@gmail.com> -" Last Change: 2020 Nov 21 +" Previous Maintainer: Chris Spiegel <cspiegel@gmail.com> +" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 -setlocal commentstring=.\\\"%s +setlocal commentstring=.\\\"\ %s setlocal comments=:.\\\" setlocal sections+=Sh diff --git a/runtime/ftplugin/nu.vim b/runtime/ftplugin/nu.vim new file mode 100644 index 0000000000..9efbc3b099 --- /dev/null +++ b/runtime/ftplugin/nu.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: Nu +" Maintainer: Marc Jakobi <marc@jakobi.dev> +" Last Change: 2024 Aug 31 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal commentstring=#\ %s + +let b:undo_ftplugin = 'setl com<' diff --git a/runtime/ftplugin/objc.lua b/runtime/ftplugin/objc.lua new file mode 100644 index 0000000000..89ab42ef54 --- /dev/null +++ b/runtime/ftplugin/objc.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/objcpp.vim b/runtime/ftplugin/objcpp.vim new file mode 100644 index 0000000000..ffba685c7d --- /dev/null +++ b/runtime/ftplugin/objcpp.vim @@ -0,0 +1 @@ +runtime! ftplugin/objc.vim diff --git a/runtime/ftplugin/obse.vim b/runtime/ftplugin/obse.vim index 6d865f05ee..bf5076f41f 100644 --- a/runtime/ftplugin/obse.vim +++ b/runtime/ftplugin/obse.vim @@ -2,8 +2,9 @@ " Language: Oblivion Language (obl) " Original Creator: Kat <katisntgood@gmail.com> " Maintainer: Kat <katisntgood@gmail.com> -" Created: August 08, 2021 -" Last Change: 13 November 2022 +" Created: 2021 Aug 08 +" Last Change: 2022 Nov 13 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -20,7 +21,7 @@ noremap <script> <buffer> <silent> ]] <nop> noremap <script> <buffer> <silent> [] <nop> noremap <script> <buffer> <silent> ][ <nop> -setlocal commentstring=;%s +setlocal commentstring=;\ %s setlocal comments=:; function s:NextSection(type, backwards, visual) diff --git a/runtime/ftplugin/ocaml.vim b/runtime/ftplugin/ocaml.vim index 20172c9b32..8b88d8d001 100644 --- a/runtime/ftplugin/ocaml.vim +++ b/runtime/ftplugin/ocaml.vim @@ -5,12 +5,14 @@ " Pierre Vittet <pierre-vittet@pvittet.com> " Stefano Zacchiroli <zack@bononia.it> " Vincent Aravantinos <firstname.name@imag.fr> +" Riley Bruins <ribru17@gmail.com> ('commentstring') " URL: https://github.com/ocaml/vim-ocaml " Last Change: " 2013 Oct 27 - Added commentstring (MM) " 2013 Jul 26 - load default compiler settings (MM) " 2013 Jul 24 - removed superfluous efm-setting (MM) " 2013 Jul 22 - applied fixes supplied by Hirotaka Hamada (MM) +" 2024 May 23 - added space in commentstring (RB) if exists("b:did_ftplugin") finish @@ -40,7 +42,7 @@ set cpo&vim " Comment string setlocal comments=sr:(*\ ,mb:\ ,ex:*) setlocal comments^=sr:(**,mb:\ \ ,ex:*) -setlocal commentstring=(*%s*) +setlocal commentstring=(*\ %s\ *) " Add mappings, unless the user didn't want this. if !exists("no_plugin_maps") && !exists("no_ocaml_maps") diff --git a/runtime/ftplugin/odin.vim b/runtime/ftplugin/odin.vim index c50fea65a3..ca534bb30c 100644 --- a/runtime/ftplugin/odin.vim +++ b/runtime/ftplugin/odin.vim @@ -2,7 +2,8 @@ " Language: Odin " Maintainer: Maxim Kim <habamax@gmail.com> " Website: https://github.com/habamax/vim-odin -" Last Change: 2024-01-15 +" Last Change: 2024 Jan 15 +" 2024-May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " " This file has been manually translated from Vim9 script. @@ -19,7 +20,7 @@ let b:undo_ftplugin = 'setlocal commentstring<' \ .. '| setlocal suffixesadd<' setlocal suffixesadd=.odin -setlocal commentstring=//%s +setlocal commentstring=//\ %s setlocal comments=s1:/*,mb:*,ex:*/,:// let &cpo = s:cpo_save diff --git a/runtime/ftplugin/openvpn.vim b/runtime/ftplugin/openvpn.vim index 56c0f25b39..9cd7b7ad1a 100644 --- a/runtime/ftplugin/openvpn.vim +++ b/runtime/ftplugin/openvpn.vim @@ -2,6 +2,7 @@ " Language: OpenVPN " Maintainer: ObserverOfTime <chronobserver@disroot.org> " Last Change: 2022 Oct 16 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists('b:did_ftplugin') finish @@ -9,6 +10,6 @@ endif let b:did_ftplugin = 1 setlocal iskeyword+=-,.,/ -setlocal comments=:#,:; commentstring=#%s +setlocal comments=:#,:; commentstring=#\ %s let b:undo_ftplugin = 'setl isk< com< cms<' diff --git a/runtime/ftplugin/pascal.vim b/runtime/ftplugin/pascal.vim index 9abd7dd382..7c800c4fbd 100644 --- a/runtime/ftplugin/pascal.vim +++ b/runtime/ftplugin/pascal.vim @@ -3,6 +3,7 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainer: Dan Sharp " Last Change: 2024 Jan 14 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 @@ -11,7 +12,7 @@ let s:cpo_save = &cpo set cpo&vim set comments=s:(*,m:\ ,e:*),s:{,m:\ ,e:} -set commentstring={%s} +set commentstring={\ %s\ } if exists("pascal_delphi") set comments+=:/// diff --git a/runtime/ftplugin/pdf.vim b/runtime/ftplugin/pdf.vim index 1ed99117d6..96c77c870a 100644 --- a/runtime/ftplugin/pdf.vim +++ b/runtime/ftplugin/pdf.vim @@ -2,13 +2,14 @@ " Language: PDF " Maintainer: Tim Pope <vimNOSPAM@tpope.info> " Last Change: 2007 Dec 16 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 -setlocal commentstring=%%s +setlocal commentstring=%\ %s setlocal comments=:% let b:undo_ftplugin = "setlocal cms< com< | unlet! b:match_words" diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim index 8c6a80eb4f..03368a7af3 100644 --- a/runtime/ftplugin/perl.vim +++ b/runtime/ftplugin/perl.vim @@ -8,6 +8,7 @@ " 2023 Sep 07 by Vim Project (safety check: don't execute perl " from current directory) " 2024 Jan 14 by Vim Project (browsefilter) +" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 @@ -22,7 +23,7 @@ setlocal formatoptions+=crqol setlocal keywordprg=perldoc\ -f setlocal comments=:# -setlocal commentstring=#%s +setlocal commentstring=#\ %s " Provided by Ned Konz <ned at bike-nomad dot com> "--------------------------------------------- diff --git a/runtime/ftplugin/php.vim b/runtime/ftplugin/php.vim index f03f14512a..e124961ba1 100644 --- a/runtime/ftplugin/php.vim +++ b/runtime/ftplugin/php.vim @@ -3,6 +3,7 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainer: Dan Sharp " Last Change: 2024 Jan 14 +" Last Change: 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -44,7 +45,7 @@ if exists("b:match_skip") endif setlocal comments=s1:/*,mb:*,ex:*/,://,:# -setlocal commentstring=/*%s*/ +setlocal commentstring=/*\ %s\ */ setlocal formatoptions+=l formatoptions-=t if get(g:, "php_autocomment", 1) diff --git a/runtime/ftplugin/ps1.vim b/runtime/ftplugin/ps1.vim index d6ab01016b..e09bbf86dc 100644 --- a/runtime/ftplugin/ps1.vim +++ b/runtime/ftplugin/ps1.vim @@ -3,6 +3,8 @@ " URL: https://github.com/PProvost/vim-ps1 " Last Change: 2021 Apr 02 " 2024 Jan 14 by Vim Project (browsefilter) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') +" 2024 Sep 19 by Konfekt (simplify keywordprg #15696) " Only do this when not done yet for this buffer if exists("b:did_ftplugin") | finish | endif @@ -14,7 +16,7 @@ let s:cpo_save = &cpo set cpo&vim setlocal tw=0 -setlocal commentstring=#%s +setlocal commentstring=#\ %s setlocal formatoptions=tcqro " Enable autocompletion of hyphenated PowerShell commands, " e.g. Get-Content or Get-ADUser @@ -34,6 +36,10 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") endif endif +" Undo the stuff we changed +let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword<" . + \ " | unlet! b:browsefilter" + " Look up keywords by Get-Help: " check for PowerShell Core in Windows, Linux or MacOS if executable('pwsh') | let s:pwsh_cmd = 'pwsh' @@ -44,21 +50,14 @@ elseif executable('powershell.exe') | let s:pwsh_cmd = 'powershell.exe' endif if exists('s:pwsh_cmd') - if !has('gui_running') && executable('less') && - \ !(exists('$ConEmuBuild') && &term =~? '^xterm') - " For exclusion of ConEmu, see https://github.com/Maximus5/ConEmu/issues/2048 - command! -buffer -nargs=1 GetHelp silent exe '!' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>" | ' . (has('unix') ? 'LESS= less' : 'less') | redraw! - elseif has('terminal') + if exists(':terminal') == 2 command! -buffer -nargs=1 GetHelp silent exe 'term ' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '') else command! -buffer -nargs=1 GetHelp echo system(s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full <args>') endif + setlocal keywordprg=:GetHelp + let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer GetHelp" endif -setlocal keywordprg=:GetHelp - -" Undo the stuff we changed -let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword< keywordprg<" . - \ " | unlet! b:browsefilter" let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/ps1xml.vim b/runtime/ftplugin/ps1xml.vim index 17bb181f37..0052de19ce 100644 --- a/runtime/ftplugin/ps1xml.vim +++ b/runtime/ftplugin/ps1xml.vim @@ -3,6 +3,7 @@ " URL: https://github.com/PProvost/vim-ps1 " Last Change: 2021 Apr 02 " 2024 Jan 14 by Vim Project (browsefilter) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Only do this when not done yet for this buffer if exists("b:did_ftplugin") | finish | endif @@ -14,7 +15,7 @@ let s:cpo_save = &cpo set cpo&vim setlocal tw=0 -setlocal commentstring=#%s +setlocal commentstring=#\ %s setlocal formatoptions=tcqro " Change the browse dialog on Win32 and GTK to show mainly PowerShell-related files diff --git a/runtime/ftplugin/qml.vim b/runtime/ftplugin/qml.vim index aa05c11bf9..53df11c6b8 100644 --- a/runtime/ftplugin/qml.vim +++ b/runtime/ftplugin/qml.vim @@ -3,6 +3,7 @@ " Maintainer: Chase Knowlden <haroldknowlden@gmail.com> " Last Change: 2023 Aug 16 " 2023 Aug 23 by Vim Project (browsefilter) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists( 'b:did_ftplugin' ) finish @@ -28,7 +29,7 @@ endif " Set 'comments' to format dashed lists in comments. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// -setlocal commentstring=//%s +setlocal commentstring=//\ %s setlocal formatoptions-=t setlocal formatoptions+=croql diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index c75dc30430..32d615c65c 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -1,6 +1,6 @@ -- Neovim filetype plugin file -- Language: Treesitter query --- Last Change: 2023 Aug 23 +-- Last Change: 2024 Jul 03 if vim.b.did_ftplugin == 1 then return @@ -32,4 +32,7 @@ if not vim.b.disable_query_linter and #query_lint_on > 0 then end -- it's a lisp! -vim.cmd([[ runtime! ftplugin/lisp.vim ]]) +vim.cmd([[runtime! ftplugin/lisp.vim]]) + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl omnifunc< iskeyword<' +vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()' diff --git a/runtime/ftplugin/racket.vim b/runtime/ftplugin/racket.vim index 84f5422140..7bfd87ddc3 100644 --- a/runtime/ftplugin/racket.vim +++ b/runtime/ftplugin/racket.vim @@ -3,8 +3,7 @@ " Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com> " Previous Maintainer: Will Langstroth <will@langstroth.com> " URL: https://github.com/benknoble/vim-racket -" Last Change: 2022 Aug 29 -" 2024 Jan 14 by Vim Project (browsefilter) +" Last Change: 2024 May 28 if exists("b:did_ftplugin") finish @@ -21,7 +20,7 @@ setlocal iskeyword=@,!,#-',*-:,<-Z,a-z,~,_,94 setlocal comments=:;;;;,:;;;,:;;,:; setlocal formatoptions+=r -"setlocal commentstring=;;%s +"setlocal commentstring=;;\ %s setlocal commentstring=#\|\ %s\ \|# setlocal formatprg=raco\ fmt diff --git a/runtime/ftplugin/raku.vim b/runtime/ftplugin/raku.vim index 941222bd38..f57427e323 100644 --- a/runtime/ftplugin/raku.vim +++ b/runtime/ftplugin/raku.vim @@ -1,10 +1,11 @@ " Vim filetype plugin file -" Language: Raku -" Maintainer: vim-perl <vim-perl@googlegroups.com> -" Homepage: https://github.com/Raku/vim-raku +" Language: Raku +" Maintainer: vim-perl <vim-perl@googlegroups.com> +" Homepage: https://github.com/Raku/vim-raku " Bugs/requests: https://github.com/Raku/vim-raku/issues -" Last Change: 2021-04-16 -" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com> +" Last Change: 2021 Apr 16 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') +" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com> " " Based on ftplugin/perl.vim by Dan Sharp <dwsharp at hotmail dot com> @@ -21,7 +22,7 @@ setlocal formatoptions+=crqol setlocal keywordprg=p6doc setlocal comments=:#\|,:#=,:# -setlocal commentstring=#%s +setlocal commentstring=#\ %s " Provided by Ned Konz <ned at bike-nomad dot com> "--------------------------------------------- diff --git a/runtime/ftplugin/rasi.vim b/runtime/ftplugin/rasi.vim new file mode 100644 index 0000000000..5f8ce862df --- /dev/null +++ b/runtime/ftplugin/rasi.vim @@ -0,0 +1,25 @@ +" Vim filetype plugin file +" Language: RASI +" Maintainer: Pierrick Guillaume <pierguill@gmail.com> +" Last Change: 2024 May 21 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +let b:undo_ftplugin = "setl com< cms< isk< inc<" + +setlocal comments=s1:/*,mb:*,ex:*/ +setlocal commentstring=//\ %s +setlocal iskeyword+=- + +let &l:include = '^\s*@import\s\+\%(url(\)\=' + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: ts=8 diff --git a/runtime/ftplugin/readline.vim b/runtime/ftplugin/readline.vim index f5934ce2c0..77fab2a611 100644 --- a/runtime/ftplugin/readline.vim +++ b/runtime/ftplugin/readline.vim @@ -2,7 +2,7 @@ " Language: readline(3) configuration file " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Last Change: 2023 Aug 22 +" Last Change: 2024 Sep 19 (simplify keywordprg #15696) if exists("b:did_ftplugin") finish @@ -34,20 +34,12 @@ 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 ReadlineKeywordPrg - \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . '3 readline' | - \ redraw! - elseif has('terminal') - command -buffer -nargs=1 ReadlineKeywordPrg - \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline' - endif - if exists(':ReadlineKeywordPrg') == 2 - setlocal iskeyword+=- - setlocal keywordprg=:ReadlineKeywordPrg - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg' - endif +if has('unix') && executable('less') && exists(':terminal') == 2 + command -buffer -nargs=1 ReadlineKeywordPrg + \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline' + setlocal iskeyword+=- + setlocal keywordprg=:ReadlineKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg' endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/requirements.vim b/runtime/ftplugin/requirements.vim index fcfc1ac269..babf33795c 100644 --- a/runtime/ftplugin/requirements.vim +++ b/runtime/ftplugin/requirements.vim @@ -36,7 +36,11 @@ let b:undo_ftplugin = "setl iskeyword< commentstring<" " pip options contain "-" setlocal iskeyword+=- setlocal commentstring=#\ %s -compiler pip_compile + +if !exists('current_compiler') + let b:undo_ftplugin ..= "| compiler make" + compiler pip_compile +endif let &cpoptions = s:save_cpoptions unlet s:save_cpoptions diff --git a/runtime/ftplugin/rmd.vim b/runtime/ftplugin/rmd.vim index a537017aad..2390ab1cb9 100644 --- a/runtime/ftplugin/rmd.vim +++ b/runtime/ftplugin/rmd.vim @@ -3,7 +3,9 @@ " Maintainer: This runtime file is looking for a new maintainer. " Former Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> " Former Repository: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: 2024 Feb 28 by Vim Project +" Last Change: +" 2024 Feb 28 by Vim Project +" 2024 Sep 23 by Vim Project: properly restore fex option " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann) " Only do this when not yet done for this buffer @@ -74,9 +76,9 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") endif if exists('b:undo_ftplugin') - let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< | unlet! b:browsefilter" + let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< fex< | unlet! b:browsefilter" else - let b:undo_ftplugin = "setl cms< com< fo< flp< isk< | unlet! b:browsefilter" + let b:undo_ftplugin = "setl cms< com< fo< flp< isk< fex< | unlet! b:browsefilter" endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/rrst.vim b/runtime/ftplugin/rrst.vim index d088f98224..73ebb75fea 100644 --- a/runtime/ftplugin/rrst.vim +++ b/runtime/ftplugin/rrst.vim @@ -3,7 +3,9 @@ " Maintainer: This runtime file is looking for a new maintainer. " Former Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> " Former Repository: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: 2024 Feb 28 by Vim Project +" Last Change: +" 2024 Feb 28 by Vim Project +" 2024 Sep 23 by Vim Project: properly restore fex option " Original work by Alex Zvoleff " Only do this when not yet done for this buffer @@ -48,9 +50,9 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") endif if exists('b:undo_ftplugin') - let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< | unlet! b:browsefilter" + let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< fex< | unlet! b:browsefilter" else - let b:undo_ftplugin = "setl cms< com< fo< flp< isk< | unlet! b:browsefilter" + let b:undo_ftplugin = "setl cms< com< fo< flp< isk< fex< | unlet! b:browsefilter" endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/rust.vim b/runtime/ftplugin/rust.vim index fb15b444d0..3e2741f919 100644 --- a/runtime/ftplugin/rust.vim +++ b/runtime/ftplugin/rust.vim @@ -1,7 +1,8 @@ -" Language: Rust -" Description: Vim ftplugin for Rust -" Maintainer: Chris Morgan <me@chrismorgan.info> -" Last Change: 2024-03-17 +" Language: Rust +" Description: Vim ftplugin for Rust +" Maintainer: Chris Morgan <me@chrismorgan.info> +" Last Change: 2024 Mar 17 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com ('commentstring') " For bugs, patches and license go to https://github.com/rust-lang/rust.vim if exists("b:did_ftplugin") @@ -36,7 +37,7 @@ if get(g:, 'rust_bang_comment_leader', 0) else setlocal comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// endif -setlocal commentstring=//%s +setlocal commentstring=//\ %s setlocal formatoptions-=t formatoptions+=croqnl " j was only added in 7.3.541, so stop complaints about its nonexistence silent! setlocal formatoptions+=j @@ -147,6 +148,7 @@ endif " Cleanup {{{1 let b:undo_ftplugin = " + \ compiler make | \ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd< \|if exists('b:rust_set_style') \|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth< diff --git a/runtime/ftplugin/scdoc.vim b/runtime/ftplugin/scdoc.vim index 552c865baa..8225e437a8 100644 --- a/runtime/ftplugin/scdoc.vim +++ b/runtime/ftplugin/scdoc.vim @@ -1,7 +1,8 @@ " scdoc filetype plugin -" Maintainer: Gregory Anders <contact@gpanders.com> -" Last Updated: 2022-05-09 -" Upstream: https://github.com/gpanders/vim-scdoc +" Maintainer: Gregory Anders <contact@gpanders.com> +" Last Updated: 2022 May 09 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') +" Upstream: https://github.com/gpanders/vim-scdoc " Only do this when not done yet for this buffer if exists('b:did_ftplugin') @@ -12,7 +13,7 @@ endif let b:did_ftplugin = 1 setlocal comments=b:; -setlocal commentstring=;%s +setlocal commentstring=;\ %s setlocal formatoptions+=t setlocal noexpandtab setlocal shiftwidth=0 diff --git a/runtime/ftplugin/scheme.vim b/runtime/ftplugin/scheme.vim index 04655bc136..63e578199d 100644 --- a/runtime/ftplugin/scheme.vim +++ b/runtime/ftplugin/scheme.vim @@ -1,11 +1,12 @@ " Vim filetype plugin file -" Language: Scheme (R7RS) -" Last Change: 2019-11-19 -" Author: Evan Hanson <evhan@foldling.org> -" Maintainer: Evan Hanson <evhan@foldling.org> +" Language: Scheme (R7RS) +" Last Change: 2024 Jun 21 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') +" Author: Evan Hanson <evhan@foldling.org> +" Maintainer: Evan Hanson <evhan@foldling.org> " Previous Maintainer: Sergey Khorev <sergey.khorev@gmail.com> -" Repository: https://git.foldling.org/vim-scheme.git -" URL: https://foldling.org/vim/ftplugin/scheme.vim +" Repository: https://git.foldling.org/vim-scheme.git +" URL: https://foldling.org/vim/ftplugin/scheme.vim if exists('b:did_ftplugin') finish @@ -16,14 +17,16 @@ set cpo&vim setl lisp setl comments=:;;;;,:;;;,:;;,:;,sr:#\|,mb:\|,ex:\|# -setl commentstring=;%s +setl commentstring=;\ %s setl define=^\\s*(def\\k* setl iskeyword=33,35-39,42-43,45-58,60-90,94,95,97-122,126 +setl formatoptions-=t -let b:undo_ftplugin = 'setl lisp< comments< commentstring< define< iskeyword<' +let b:undo_ftplugin = 'setl lisp< comments< commentstring< define< iskeyword< formatoptions<' setl lispwords+=case setl lispwords+=define +setl lispwords+=define-library setl lispwords+=define-record-type setl lispwords+=define-syntax setl lispwords+=define-values diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim index c47aa520e9..4c7695dcc6 100644 --- a/runtime/ftplugin/sh.vim +++ b/runtime/ftplugin/sh.vim @@ -4,7 +4,7 @@ " Previous Maintainer: Dan Sharp " Contributor: Enno Nagel <ennonagel+vim@gmail.com> " Eisuke Kawashima -" Last Change: 2024 May 06 by Vim Project (MANPAGER=) +" Last Change: 2024 Sep 19 by Vim Project (compiler shellcheck) if exists("b:did_ftplugin") finish @@ -45,15 +45,18 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") endif if get(b:, "is_bash", 0) - if !has("gui_running") && executable("less") - command! -buffer -nargs=1 ShKeywordPrg silent exe '!bash -c "{ help "<args>" 2>/dev/null || MANPAGER= man "<args>"; } | LESS= less"' | redraw! - elseif has("terminal") + if exists(':terminal') == 2 command! -buffer -nargs=1 ShKeywordPrg silent exe ':term bash -c "help "<args>" 2>/dev/null || man "<args>""' else command! -buffer -nargs=1 ShKeywordPrg echo system('bash -c "help <args>" 2>/dev/null || MANPAGER= man "<args>"') endif setlocal keywordprg=:ShKeywordPrg let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer ShKeywordPrg" + + if !exists('current_compiler') + compiler shellcheck + endif + let b:undo_ftplugin .= ' | compiler make' endif let &cpo = s:save_cpo diff --git a/runtime/ftplugin/snakemake.vim b/runtime/ftplugin/snakemake.vim new file mode 100644 index 0000000000..ab90ca10b5 --- /dev/null +++ b/runtime/ftplugin/snakemake.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: snakemake +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jun 13 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim index 9040e19ce1..fa125be52c 100644 --- a/runtime/ftplugin/spec.vim +++ b/runtime/ftplugin/spec.vim @@ -2,8 +2,9 @@ " Filename: spec.vim " Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com " Former Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com> (until March 2014) -" Last Change: Mon Jun 01 21:15 MSK 2015 Igor Gnatenko -" Update by Zdenek Dohnal, 2022 May 17 +" Last Change: 2015 Jun 01 +" Update by Zdenek Dohnal, 2022 May 17 +" 2024 Sep 10 by Vim Project: add epoch support for spec changelog, #15537 if exists("b:did_ftplugin") finish @@ -66,9 +67,11 @@ if !exists("*s:SpecChangelog") endif let line = 0 let name = "" + let epoch = "" let ver = "" let rel = "" let nameline = -1 + let epochline = -1 let verline = -1 let relline = -1 let chgline = -1 @@ -77,6 +80,9 @@ if !exists("*s:SpecChangelog") if name == "" && linestr =~? '^Name:' let nameline = line let name = substitute(strpart(linestr,5), '^[ ]*\([^ ]\+\)[ ]*$','\1','') + elseif epoch == "" && linestr =~? '^Epoch:' + let epochline = line + let epoch = substitute(strpart(linestr,6), '^[ ]*\([^ ]\+\)[ ]*$','\1','') elseif ver == "" && linestr =~? '^Version:' let verline = line let ver = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','') @@ -93,6 +99,7 @@ if !exists("*s:SpecChangelog") if nameline != -1 && verline != -1 && relline != -1 let include_release_info = exists("g:spec_chglog_release_info") let name = s:ParseRpmVars(name, nameline) + let epoch = s:ParseRpmVars(epoch, epochline) let ver = s:ParseRpmVars(ver, verline) let rel = s:ParseRpmVars(rel, relline) else @@ -117,6 +124,9 @@ if !exists("*s:SpecChangelog") if chgline != -1 let tmptime = v:lc_time language time C + if strlen(epoch) + let ver = epoch.":".ver + endif let parsed_format = "* ".strftime(format)." - ".ver."-".rel execute "language time" tmptime let release_info = "+ ".name."-".ver."-".rel diff --git a/runtime/ftplugin/sql.vim b/runtime/ftplugin/sql.vim index 61b7e67255..3b56acd674 100644 --- a/runtime/ftplugin/sql.vim +++ b/runtime/ftplugin/sql.vim @@ -3,8 +3,9 @@ " Version: 12.0 " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> " Last Change: 2017 Mar 07 -" 2024 Jan 14 by Vim Project (browsefilter) -" 2024 May 18 by Vim Project (set comment options) +" 2024 Jan 14 by Vim Project: browsefilter +" 2024 May 18 by Vim Project: set comment options +" 2024 Aug 14 by Vim Project: remove redundant code " Download: http://vim.sourceforge.net/script.php?script_id=454 " For more details please use: @@ -92,13 +93,19 @@ " Only do this when not done yet for this buffer " This ftplugin can be used with other ftplugins. So ensure loading " happens if all elements of this plugin have not yet loaded. -if exists("b:did_ftplugin") && exists("b:current_ftplugin") && b:current_ftplugin == 'sql' +if exists("b:did_ftplugin") finish endif +" Don't load another plugin for this buffer +let b:did_ftplugin = 1 + let s:save_cpo = &cpo set cpo&vim +let b:undo_ftplugin = "setl comments< commentstring< formatoptions< define< omnifunc<" . + \ " | unlet! b:browsefilter b:match_words" + " Disable autowrapping for code, but enable for comments " t Auto-wrap text using textwidth " c Auto-wrap comments using textwidth, inserting the current comment @@ -263,19 +270,6 @@ elseif exists("g:sql_type_default") endif endif -" If the above runtime command succeeded, do not load the default settings -" as they should have already been loaded from a previous run. -if exists("b:did_ftplugin") && exists("b:current_ftplugin") && b:current_ftplugin == 'sql' - finish -endif - -let b:undo_ftplugin = "setl comments< commentstring< formatoptions< define< omnifunc<" . - \ " | unlet! b:browsefilter b:match_words" - -" Don't load another plugin for this buffer -let b:did_ftplugin = 1 -let b:current_ftplugin = 'sql' - " Win32 and GTK can filter files in the browse dialog if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "SQL Files (*.sql)\t*.sql\n" diff --git a/runtime/ftplugin/squirrel.vim b/runtime/ftplugin/squirrel.vim new file mode 100644 index 0000000000..559be88001 --- /dev/null +++ b/runtime/ftplugin/squirrel.vim @@ -0,0 +1,17 @@ +" Vim filetype plugin +" Language: Squirrel +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 06 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +" Set 'comments' to format dashed lists in comments. +" Also include ///, used for Doxygen. +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// + +setlocal commentstring=//\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/sshconfig.vim b/runtime/ftplugin/sshconfig.vim index 4a054da52f..1cc4e609b0 100644 --- a/runtime/ftplugin/sshconfig.vim +++ b/runtime/ftplugin/sshconfig.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file -" Language: OpenSSH client configuration file -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2023-10-07 +" Language: OpenSSH client configuration file +" Maintainer: This runtime file is looking for a new maintainer. +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2024-09-19 (simplify keywordprg #15696) if exists("b:did_ftplugin") finish @@ -14,20 +15,12 @@ set cpo&vim 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 SshconfigKeywordPrg - \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '$'' --hilite-search" man ' . 'ssh_config' | - \ redraw! - elseif has('terminal') - command -buffer -nargs=1 SshconfigKeywordPrg - \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config' - endif - if exists(':SshconfigKeywordPrg') == 2 - setlocal iskeyword+=- - setlocal keywordprg=:SshconfigKeywordPrg - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SshconfigKeywordPrg' - endif +if has('unix') && executable('less') && exists(':terminal') == 2 + command -buffer -nargs=1 SshconfigKeywordPrg + \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config' + setlocal iskeyword+=- + setlocal keywordprg=:SshconfigKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SshconfigKeywordPrg' endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/stata.lua b/runtime/ftplugin/stata.lua new file mode 100644 index 0000000000..89ab42ef54 --- /dev/null +++ b/runtime/ftplugin/stata.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/sudoers.vim b/runtime/ftplugin/sudoers.vim index 81ce7906a9..e87fedaa01 100644 --- a/runtime/ftplugin/sudoers.vim +++ b/runtime/ftplugin/sudoers.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file -" Language: sudoers(5) configuration files -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2023-10-07 +" Language: sudoers(5) configuration files +" Maintainer: This runtime file is looking for a new maintainer. +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2024-09-19 (simplify keywordprg #15696) if exists("b:did_ftplugin") finish @@ -15,20 +16,12 @@ 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 SudoersKeywordPrg - \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''\b' . <q-args> . '\b'' --hilite-search" man ' . 'sudoers' | - \ redraw! - elseif has('terminal') - command -buffer -nargs=1 SudoersKeywordPrg - \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'sudoers' - endif - if exists(':SudoersKeywordPrg') == 2 - setlocal iskeyword+=- - setlocal keywordprg=:SudoersKeywordPrg - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SudoersKeywordPrg' - endif +if has('unix') && executable('less') && exists(':terminal') == 2 + command -buffer -nargs=1 SudoersKeywordPrg + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'sudoers' + setlocal iskeyword+=- + setlocal keywordprg=:SudoersKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SudoersKeywordPrg' endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/supercollider.lua b/runtime/ftplugin/supercollider.lua new file mode 100644 index 0000000000..89ab42ef54 --- /dev/null +++ b/runtime/ftplugin/supercollider.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/svelte.vim b/runtime/ftplugin/svelte.vim new file mode 100644 index 0000000000..e0ec4e0ae3 --- /dev/null +++ b/runtime/ftplugin/svelte.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: svelte +" Maintainer: Igor Lacerda <igorlafarsi@gmail.com> +" Last Change: 2024 Jun 09 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl commentstring=<!--\ %s\ --> + +let b:undo_ftplugin = 'setl cms<' diff --git a/runtime/ftplugin/swift.lua b/runtime/ftplugin/swift.lua new file mode 100644 index 0000000000..89ab42ef54 --- /dev/null +++ b/runtime/ftplugin/swift.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/systemd.vim b/runtime/ftplugin/systemd.vim index 8bcacdd381..1b1d242029 100644 --- a/runtime/ftplugin/systemd.vim +++ b/runtime/ftplugin/systemd.vim @@ -1,37 +1,30 @@ " Vim filetype plugin file " Language: systemd.unit(5) " Keyword Lookup Support: Enno Nagel <enno.nagel+vim@gmail.com> -" Latest Revision: 2023-10-07 +" Latest Revision: 2024-10-02 (small fixes to &keywordprg) -if !exists('b:did_ftplugin') - " Looks a lot like dosini files. - runtime! ftplugin/dosini.vim +if exists("b:did_ftplugin") + finish endif +" Looks a lot like dosini files. +runtime! ftplugin/dosini.vim -if has('unix') && executable('less') - if !has('gui_running') - command -buffer -nargs=1 SystemdKeywordPrg silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw! - elseif has('terminal') - command -buffer -nargs=1 SystemdKeywordPrg silent exe 'term ' . KeywordLookup_systemd(<q-args>) - endif - 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*$') - 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=:SystemdKeywordPrg - if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) - let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<' +if has('unix') && executable('less') && exists(':terminal') == 2 + command! -buffer -nargs=1 SystemdKeywordPrg silent exe 'term ++close ' KeywordLookup_systemd(<q-args>) + silent! 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 'env LESS= MANPAGER="less --pattern=''(^|,)\\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section else - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SystemdKeywordPrg' + return 'env LESS= MANPAGER="less --pattern=''(^|,)\\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd' endif + endfunction + setlocal iskeyword+=- + setlocal keywordprg=:SystemdKeywordPrg + if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) + let b:undo_ftplugin = 'setlocal keywordprg< iskeyword< | sil! delc -buffer SystemdKeywordPrg' + else + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SystemdKeywordPrg' endif endif diff --git a/runtime/ftplugin/tcl.vim b/runtime/ftplugin/tcl.vim index fa900096c0..214d9c256d 100644 --- a/runtime/ftplugin/tcl.vim +++ b/runtime/ftplugin/tcl.vim @@ -3,6 +3,7 @@ " Maintainer: Robert L Hicks <sigzero@gmail.com> " Latest Revision: 2009-05-01 " 2024 Jan 14 by Vim Project (browsefilter) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -15,7 +16,7 @@ let s:cpo_save = &cpo set cpo-=C setlocal comments=:# -setlocal commentstring=#%s +setlocal commentstring=#\ %s setlocal formatoptions+=croql " Change the browse dialog on Windows to show mainly Tcl-related files diff --git a/runtime/ftplugin/terraform.vim b/runtime/ftplugin/terraform.vim new file mode 100644 index 0000000000..b03cab3638 --- /dev/null +++ b/runtime/ftplugin/terraform.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: terraform +" Maintainer: Janno Tjarks (janno.tjarks@mailbox.org) +" Last Change: 2024 Jul 3 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal commentstring=#\ %s +setlocal comments=://,:# + +let b:undo_ftplugin = "setlocal commentstring< comments<" diff --git a/runtime/ftplugin/tf.vim b/runtime/ftplugin/tf.vim new file mode 100644 index 0000000000..1571d5e508 --- /dev/null +++ b/runtime/ftplugin/tf.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: tf (TinyFugue) +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 06 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:#,:; commentstring=;\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/thrift.vim b/runtime/ftplugin/thrift.vim new file mode 100644 index 0000000000..dd18e19948 --- /dev/null +++ b/runtime/ftplugin/thrift.vim @@ -0,0 +1,17 @@ +" Vim filetype plugin file +" Language: Apache Thrift +" Maintainer: Yinzuo Jiang <jiangyinzuo@foxmail.com> +" Last Change: 2024/07/29 + +if exists("b:did_ftplugin") + finish +endif + +let b:did_ftplugin = 1 + +" Thrift supports shell-style, C-style multi-line as well as single-line Java/C++ style comments. +" Reference: https://diwakergupta.github.io/thrift-missing-guide/#_language_reference +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://,b:# +setlocal commentstring=//\ %s + +let b:undo_ftplugin = 'setl comments< commentstring<' diff --git a/runtime/ftplugin/typescript.vim b/runtime/ftplugin/typescript.vim index 680521df31..fb5f4e135f 100644 --- a/runtime/ftplugin/typescript.vim +++ b/runtime/ftplugin/typescript.vim @@ -2,6 +2,7 @@ " Language: TypeScript " Maintainer: Doug Kearns <dougkearns@gmail.com> " Last Change: 2024 Jan 14 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -18,7 +19,7 @@ setlocal formatoptions-=t formatoptions+=croql " Set 'comments' to format dashed lists in comments. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// -setlocal commentstring=//%s +setlocal commentstring=//\ %s setlocal suffixesadd+=.ts,.d.ts,.tsx,.js,.jsx,.cjs,.mjs diff --git a/runtime/ftplugin/typst.vim b/runtime/ftplugin/typst.vim index c2d7811ace..895fc688d9 100644 --- a/runtime/ftplugin/typst.vim +++ b/runtime/ftplugin/typst.vim @@ -1,14 +1,27 @@ -" Vim filetype plugin -" Language: typst -" Maintainer: Riley Bruins <ribru17@gmail.com> -" Last Change: 2024 May 19 +" Vim filetype plugin file +" Language: Typst +" Maintainer: Gregory Anders +" Last Change: 2024 Oct 04 +" Based on: https://github.com/kaarmu/typst.vim if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 -setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// setlocal commentstring=//\ %s +setlocal comments=s1:/*,mb:*,ex:*/,:// +setlocal formatoptions+=croq +setlocal suffixesadd=.typ -let b:undo_ftplugin = 'setl com< cms<' +let b:undo_ftplugin = 'setl cms< com< fo< sua<' + +if get(g:, 'typst_conceal', 0) + setlocal conceallevel=2 + let b:undo_ftplugin .= ' cole<' +endif + +if !exists('current_compiler') + compiler typst + let b:undo_ftplugin ..= "| compiler make" +endif diff --git a/runtime/ftplugin/udevrules.vim b/runtime/ftplugin/udevrules.vim index ec365f04c2..e6c7f113c2 100644 --- a/runtime/ftplugin/udevrules.vim +++ b/runtime/ftplugin/udevrules.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file -" Language: udev(8) rules file -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2023-10-07 +" Language: udev(8) rules file +" Maintainer: This runtime file is looking for a new maintainer. +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2024-09-19 (simplify keywordprg #15696) if exists("b:did_ftplugin") finish @@ -15,20 +16,12 @@ 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 UdevrulesKeywordPrg - \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'udev' | - \ redraw! - elseif has('terminal') - command -buffer -nargs=1 UdevrulesKeywordPrg - \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev' - endif - if exists(':UdevrulesKeywordPrg') == 2 - setlocal iskeyword+=- - setlocal keywordprg=:UdevrulesKeywordPrg - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer UdevrulesKeywordPrg' - endif +if has('unix') && executable('less') && exists(':terminal') == 2 + command -buffer -nargs=1 UdevrulesKeywordPrg + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev' + setlocal iskeyword+=- + setlocal keywordprg=:UdevrulesKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer UdevrulesKeywordPrg' endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 5c99df7f5a..b5e8e693f6 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -2,6 +2,7 @@ " Language: Vim " Maintainer: Doug Kearns <dougkearns@gmail.com> " Last Change: 2024 Apr 13 +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Former Maintainer: Bram Moolenaar <Bram@vim.org> " Only do this when not done yet for this buffer @@ -51,7 +52,7 @@ setlocal keywordprg=:help " Comments starts with # in Vim9 script. We have to guess which one to use. if "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>' - setlocal commentstring=#%s + setlocal commentstring=#\ %s else setlocal commentstring=\"%s endif @@ -66,9 +67,6 @@ if &tw == 0 setlocal tw=78 endif -" Prefer Vim help instead of manpages. -setlocal keywordprg=:help - if !exists("no_plugin_maps") && !exists("no_vim_maps") let b:did_add_maps = 1 diff --git a/runtime/ftplugin/wat.vim b/runtime/ftplugin/wat.vim index 35d2d6a322..ad1140bbb5 100644 --- a/runtime/ftplugin/wat.vim +++ b/runtime/ftplugin/wat.vim @@ -2,6 +2,7 @@ " Language: WebAssembly " Maintainer: rhysd <lin90162@yahoo.co.jp> " Last Change: Nov 14, 2023 +" May 24, 2024 by Riley Bruins <ribru17@gmail.com> ('commentstring') " For bugs, patches and license go to https://github.com/rhysd/vim-wasm if exists("b:did_ftplugin") @@ -10,7 +11,7 @@ endif let b:did_ftplugin = 1 setlocal comments=s:(;,e:;),:;; -setlocal commentstring=(;%s;) +setlocal commentstring=(;\ %s\ ;) setlocal formatoptions-=t setlocal iskeyword+=$,.,/ diff --git a/runtime/ftplugin/xdefaults.lua b/runtime/ftplugin/xdefaults.lua deleted file mode 100644 index b4e68148f5..0000000000 --- a/runtime/ftplugin/xdefaults.lua +++ /dev/null @@ -1 +0,0 @@ -vim.bo.commentstring = '/*%s*/' diff --git a/runtime/ftplugin/xdefaults.vim b/runtime/ftplugin/xdefaults.vim index c1aff70176..26c7516f8e 100644 --- a/runtime/ftplugin/xdefaults.vim +++ b/runtime/ftplugin/xdefaults.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file -" Language: X resources files like ~/.Xdefaults (xrdb) -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2008-07-09 +" Language: X resources files like ~/.Xdefaults (xrdb) +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2008 Jul 09 +" 2024 Jun 03 by Riley Bruins <ribru17@gmail.com> ('commentstring') if exists("b:did_ftplugin") finish @@ -13,7 +14,7 @@ set cpo&vim let b:undo_ftplugin = "setl com< cms< inc< fo<" -setlocal comments=s1:/*,mb:*,ex:*/,:! commentstring& inc& +setlocal comments=s1:/*,mb:*,ex:*/,:! commentstring=!\ %s inc& setlocal formatoptions-=t formatoptions+=croql let &cpo = s:cpo_save diff --git a/runtime/ftplugin/xml.vim b/runtime/ftplugin/xml.vim index b81c3980d2..83c528eff2 100644 --- a/runtime/ftplugin/xml.vim +++ b/runtime/ftplugin/xml.vim @@ -3,6 +3,7 @@ " Maintainer: Christian Brabandt <cb@256bit.org> " Last Changed: Dec 07th, 2018 " 2024 Jan 14 by Vim Project (browsefilter) +" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') " Repository: https://github.com/chrisbra/vim-xml-ftplugin " Previous Maintainer: Dan Sharp " URL: http://dwsharp.users.sourceforge.net/vim/ftplugin @@ -15,7 +16,7 @@ let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo&vim -setlocal commentstring=<!--%s--> +setlocal commentstring=<!--\ %s\ --> " Remove the middlepart from the comments section, as this causes problems: " https://groups.google.com/d/msg/vim_dev/x4GT-nqa0Kg/jvtRnEbtAnMJ setlocal comments=s:<!--,e:--> diff --git a/runtime/ftplugin/xs.lua b/runtime/ftplugin/xs.lua new file mode 100644 index 0000000000..89ab42ef54 --- /dev/null +++ b/runtime/ftplugin/xs.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = '// %s' + +vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n setl commentstring<' diff --git a/runtime/ftplugin/yacc.vim b/runtime/ftplugin/yacc.vim new file mode 100644 index 0000000000..d95e1ee600 --- /dev/null +++ b/runtime/ftplugin/yacc.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin +" Language: Yacc +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Jul 06 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +" Set 'comments' to format dashed lists in comments. +" Also include ///, used for Doxygen. +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// +setlocal commentstring=//\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/yaml.vim b/runtime/ftplugin/yaml.vim index 8bfc45e4c8..4e12350c22 100644 --- a/runtime/ftplugin/yaml.vim +++ b/runtime/ftplugin/yaml.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: YAML (YAML Ain't Markup Language) " Previous Maintainer: Nikolai Weibull <now@bitwi.se> (inactive) -" Last Change: 2020 Mar 02 +" Last Change: 2024 Oct 04 if exists("b:did_ftplugin") finish @@ -18,7 +18,10 @@ setlocal formatoptions-=t formatoptions+=croql " rime input method engine uses `*.custom.yaml` as its config files if expand('%:r:e') ==# 'custom' - compiler rime_deployer + if !exists('current_compiler') + compiler rime_deployer + let b:undo_ftplugin ..= "| compiler make" + endif setlocal include=__include:\\s* let b:undo_ftplugin ..= " inc<" endif diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim index ea229b6a49..ea584ed086 100644 --- a/runtime/ftplugin/zig.vim +++ b/runtime/ftplugin/zig.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Zig " Maintainer: Mathias Lindgren <math.lindgren@gmail.com> -" Last Change: 2024 May 21 +" Last Change: 2024 Oct 04 " Based on: https://github.com/ziglang/zig.vim if exists("b:did_ftplugin") @@ -13,8 +13,6 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -compiler zig_build - " Match Zig builtin fns setlocal iskeyword+=@-@ setlocal formatoptions-=t formatoptions+=croql @@ -47,6 +45,11 @@ if exists('g:zig_std_dir') let b:undo_ftplugin .= ' | setl pa<' endif +if !exists('current_compiler') + compiler zig_build + let b:undo_ftplugin .= "| compiler make" +endif + let &cpo = s:cpo_save unlet s:cpo_save " vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab diff --git a/runtime/ftplugin/zsh.vim b/runtime/ftplugin/zsh.vim index aee890024f..5d4f4fe256 100644 --- a/runtime/ftplugin/zsh.vim +++ b/runtime/ftplugin/zsh.vim @@ -2,7 +2,7 @@ " Language: Zsh shell script " Maintainer: Christian Brabandt <cb@256bit.org> " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2024 May 06 by Vim Project (MANPAGER=) +" Latest Revision: 2024 Sep 19 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-zsh @@ -19,18 +19,18 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql let b:undo_ftplugin = "setl com< cms< fo< " if executable('zsh') && &shell !~# '/\%(nologin\|false\)$' - if !has('gui_running') && executable('less') - command! -buffer -nargs=1 ZshKeywordPrg silent exe '!MANPAGER= zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw! - elseif has('terminal') + if exists(':terminal') == 2 command! -buffer -nargs=1 ZshKeywordPrg silent exe ':term zsh -c "autoload -Uz run-help; run-help <args>"' else command! -buffer -nargs=1 ZshKeywordPrg echo system('MANPAGER= zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null"') endif + setlocal keywordprg=:ZshKeywordPrg + let b:undo_ftplugin .= '| setl keywordprg< | sil! delc -buffer ZshKeywordPrg' + if !exists('current_compiler') compiler zsh endif - setlocal keywordprg=:ZshKeywordPrg - let b:undo_ftplugin .= 'keywordprg< | sil! delc -buffer ZshKeywordPrg' + let b:undo_ftplugin .= ' | compiler make' endif let b:match_words = '\<if\>:\<elif\>:\<else\>:\<fi\>' |