diff options
Diffstat (limited to 'runtime/ftplugin')
53 files changed, 651 insertions, 166 deletions
diff --git a/runtime/ftplugin/abaqus.vim b/runtime/ftplugin/abaqus.vim index b263d0c318..5ce565ef3f 100644 --- a/runtime/ftplugin/abaqus.vim +++ b/runtime/ftplugin/abaqus.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Abaqus finite element input file (www.abaqus.com) " Maintainer: Carl Osterwisch <osterwischc@asme.org> -" Last Change: 2012 Apr 30 +" Last Change: 2022 May 09 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") | finish | endif @@ -86,11 +86,11 @@ let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]" \ . "|unmap <buffer> <LocalLeader><LocalLeader>" " Undo must be done in nocompatible mode for <LocalLeader>. -let b:undo_ftplugin = "let s:cpo_save = &cpoptions|" +let b:undo_ftplugin = "let b:cpo_save = &cpoptions|" \ . "set cpoptions&vim|" \ . b:undo_ftplugin - \ . "|let &cpoptions = s:cpo_save" - \ . "|unlet s:cpo_save" + \ . "|let &cpoptions = b:cpo_save" + \ . "|unlet b:cpo_save" " Restore saved compatibility options let &cpoptions = s:cpo_save diff --git a/runtime/ftplugin/ant.vim b/runtime/ftplugin/ant.vim index 5905858896..aee07ca4b9 100644 --- a/runtime/ftplugin/ant.vim +++ b/runtime/ftplugin/ant.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: ant -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/aspvbs.vim b/runtime/ftplugin/aspvbs.vim index 660dab4685..70a130d287 100644 --- a/runtime/ftplugin/aspvbs.vim +++ b/runtime/ftplugin/aspvbs.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: aspvbs -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/basic.vim b/runtime/ftplugin/basic.vim index c6ec254dfc..4399fbf3ad 100644 --- a/runtime/ftplugin/basic.vim +++ b/runtime/ftplugin/basic.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file -" Language: BASIC +" Language: BASIC (QuickBASIC 4.5) " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2015 Jan 10 +" Last Change: 2022 Jun 22 if exists("b:did_ftplugin") finish @@ -11,17 +11,47 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -setlocal comments=:REM,:' +setlocal comments=:REM\ ,:Rem\ ,:rem\ ,:' setlocal commentstring='\ %s setlocal formatoptions-=t formatoptions+=croql -if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" . - \ "All Files (*.*)\t*.*\n" +let b:undo_ftplugin = "setl fo< com< cms<" + +" TODO: support exit ... as middle matches? +if exists("loaded_matchit") && !exists("b:match_words") + let s:line_start = '\%(^\s*\)\@<=' + let s:not_end = '\%(end\s\+\)\@<!' + let s:not_end_or_exit = '\%(\%(end\|exit\)\s\+\)\@<!' + + let b:match_ignorecase = 1 + let b:match_words = + \ s:not_end_or_exit .. '\<def\s\+fn:\<end\s\+def\>,' .. + \ s:not_end_or_exit .. '\<function\>:\<end\s\+function\>,' .. + \ s:not_end_or_exit .. '\<sub\>:\<end\s\+sub\>,' .. + \ s:not_end .. '\<type\>:\<end\s\+type\>,' .. + \ s:not_end .. '\<select\>:\%(select\s\+\)\@<!\<case\%(\s\+\%(else\|is\)\)\=\>:\<end\s\+select\>,' .. + \ '\<do\>:\<loop\>,' .. + \ '\<for\>\%(\s\+\%(input\|output\|random\|append\|binary\)\)\@!:\<next\>,' .. + \ '\<while\>:\<wend\>,' .. + \ s:line_start .. 'if\%(.*\<then\s*\%($\|''\)\)\@=:\<\%(' .. s:line_start .. 'else\|elseif\)\>:\<end\s\+if\>,' .. + \ '\<lock\>:\<unlock\>' + let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string" || ' .. + \ 'strpart(getline("."), 0, col(".") ) =~? "\\<exit\\s\\+"' + + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_skip b:match_words" + + unlet s:line_start s:not_end s:not_end_or_exit endif -let b:undo_ftplugin = "setl fo< com< cms< sua<" . - \ " | unlet! b:browsefilter" +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" .. + \ "BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n" .. + \ "All Files (*.*)\t*.*\n" + let b:basic_set_browsefilter = 1 + let b:undo_ftplugin ..= " | unlet! b:browsefilter b:basic_set_browsefilter" +endif let &cpo = s:cpo_save unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index d4564a4aec..cfaf26f66c 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: C " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2021 Sep 21 +" Last Change: 2022 Apr 08 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -31,7 +31,8 @@ if exists('&ofu') endif " Set 'comments' to format dashed lists in comments. -setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// +" Also include ///, used for Doxygen. + setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// " When the matchit plugin is loaded, this makes the % command skip parens and " braces in comments properly. diff --git a/runtime/ftplugin/clojure.vim b/runtime/ftplugin/clojure.vim index 81d53b1227..c922d75699 100644 --- a/runtime/ftplugin/clojure.vim +++ b/runtime/ftplugin/clojure.vim @@ -5,7 +5,7 @@ " Meikel Brandmeyer <mb@kotka.de> " URL: https://github.com/clojure-vim/clojure.vim " License: Vim (see :h license) -" Last Change: 2021-10-26 +" Last Change: 2022-03-24 if exists("b:did_ftplugin") finish @@ -43,7 +43,7 @@ setlocal commentstring=;\ %s " specially and hence are not indented specially. " " -*- LISPWORDS -*- -" Generated from https://github.com/clojure-vim/clojure.vim/blob/62b215f079ce0f3834fd295c7a7f6bd8cc54bcc3/clj/src/vim_clojure_static/generate.clj +" Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,if-some,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,when-some,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test " Provide insert mode completions for special forms and clojure.core. As @@ -66,10 +66,10 @@ endif " Filter files in the browse dialog if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" . - \ "ClojureScript Source Files (*.cljs)\t*.cljs\n" . - \ "Java Source Files (*.java)\t*.java\n" . - \ "All Files (*.*)\t*.*\n" + let b:browsefilter = "All Files\t*\n" . + \ "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" . + \ "EDN Files\t*.edn\n" . + \ "Java Files\t*.java\n" let b:undo_ftplugin .= ' | unlet! b:browsefilter' endif diff --git a/runtime/ftplugin/config.vim b/runtime/ftplugin/config.vim index 7fde42ebf5..73136cbc66 100644 --- a/runtime/ftplugin/config.vim +++ b/runtime/ftplugin/config.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: config -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/confini.vim b/runtime/ftplugin/confini.vim new file mode 100644 index 0000000000..310e046353 --- /dev/null +++ b/runtime/ftplugin/confini.vim @@ -0,0 +1,10 @@ +" Vim filetype plugin file +" Language: confini + +" Quit if a ftplugin file was already loaded +if exists("b:did_ftplugin") + finish +endif + +" Use the cfg plugin, it's similar enough. +runtime! ftplugin/cfg.vim diff --git a/runtime/ftplugin/cpp.vim b/runtime/ftplugin/cpp.vim index f9d31cbec3..58c4e4b24a 100644 --- a/runtime/ftplugin/cpp.vim +++ b/runtime/ftplugin/cpp.vim @@ -10,6 +10,7 @@ endif " Behaves mostly just like C runtime! ftplugin/c.vim ftplugin/c_*.vim ftplugin/c/*.vim +runtime! ftplugin/c.lua ftplugin/c_*.lua ftplugin/c/*.lua " C++ uses templates with <things> " Disabled, because it gives an error for typing an unmatched ">". diff --git a/runtime/ftplugin/cs.vim b/runtime/ftplugin/cs.vim index 7c2cbda32f..f53ffcbc8e 100644 --- a/runtime/ftplugin/cs.vim +++ b/runtime/ftplugin/cs.vim @@ -1,29 +1,43 @@ " Vim filetype plugin file -" Language: C# -" Maintainer: Johannes Zellner <johannes@zellner.org> -" Last Change: Tue, 09 Mar 2004 14:09:33 CET +" Language: C# +" Maintainer: Nick Jensen <nickspoon@gmail.com> +" Former Maintainer: Johannes Zellner <johannes@zellner.org> +" Last Change: 2021-12-07 +" License: Vim (see :h license) +" Repository: https://github.com/nickspoons/vim-cs -" Only do this when not done yet for this buffer -if exists("b:did_ftplugin") +if exists('b:did_ftplugin') finish endif - -" Don't load another plugin for this buffer let b:did_ftplugin = 1 -let s:keepcpo= &cpo -set cpo&vim + +let s:save_cpo = &cpoptions +set cpoptions&vim " Set 'formatoptions' to break comment lines but not other lines, " and insert the comment leader when hitting <CR> or using "o". -setlocal fo-=t fo+=croql +setlocal formatoptions-=t formatoptions+=croql " Set 'comments' to format dashed lists in comments. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// -if has("gui_win32") && !exists("b:browsefilter") - let b:browsefilter = "C# Source Files (*.cs)\t*.cs\n" . - \ "All Files (*.*)\t*.*\n" +let b:undo_ftplugin = 'setl com< fo<' + +if exists('loaded_matchit') && !exists('b:match_words') + " #if/#endif support included by default + let b:match_words = '\%(^\s*\)\@<=#\s*region\>:\%(^\s*\)\@<=#\s*endregion\>,' + let b:undo_ftplugin .= ' | unlet! b:match_words' endif -let &cpo = s:keepcpo -unlet s:keepcpo +if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter') + let b:browsefilter = "C# Source Files (*.cs *.csx)\t*.cs;*.csx\n" . + \ "C# Project Files (*.csproj)\t*.csproj\n" . + \ "Visual Studio Solution Files (*.sln)\t*.sln\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= ' | unlet! b:browsefilter' +endif + +let &cpoptions = s:save_cpo +unlet s:save_cpo + +" vim:et:sw=2:sts=2 diff --git a/runtime/ftplugin/csc.vim b/runtime/ftplugin/csc.vim index 3a09c3bf8b..7b4126a503 100644 --- a/runtime/ftplugin/csc.vim +++ b/runtime/ftplugin/csc.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: csc -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 diff --git a/runtime/ftplugin/csh.vim b/runtime/ftplugin/csh.vim index 929823219c..ca5da5a8b9 100644 --- a/runtime/ftplugin/csh.vim +++ b/runtime/ftplugin/csh.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: csh " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" Previous Maintainer: Dan Sharp " Contributor: Johannes Zellner <johannes@zellner.org> " Last Change: 2021 Oct 15 diff --git a/runtime/ftplugin/dtd.vim b/runtime/ftplugin/dtd.vim index 6c08f6691d..a046118c70 100644 --- a/runtime/ftplugin/dtd.vim +++ b/runtime/ftplugin/dtd.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: dtd -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 diff --git a/runtime/ftplugin/elixir.vim b/runtime/ftplugin/elixir.vim new file mode 100644 index 0000000000..3b38051d08 --- /dev/null +++ b/runtime/ftplugin/elixir.vim @@ -0,0 +1,11 @@ +" Elixir filetype plugin +" Language: Elixir +" Maintainer: Mitchell Hanberg <vimNOSPAM@mitchellhanberg.com> +" Last Change: 2022 Apr 20 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal commentstring=#\ %s diff --git a/runtime/ftplugin/elm.vim b/runtime/ftplugin/elm.vim index 1e10346186..8c2de190b0 100644 --- a/runtime/ftplugin/elm.vim +++ b/runtime/ftplugin/elm.vim @@ -1,7 +1,7 @@ " Elm filetype plugin file " Language: Elm " Maintainer: Andreas Scharf <as@99n.de> -" Latest Revision: 2020-05-29 +" Latest Revision: 2022-04-25 if exists("b:did_ftplugin") finish @@ -14,5 +14,7 @@ set cpo&vim setlocal comments=s1fl:{-,mb:\ ,ex:-},:-- setlocal commentstring=--\ %s +let b:undo_ftplugin = "setl com< cms<" + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/fennel.vim b/runtime/ftplugin/fennel.vim new file mode 100644 index 0000000000..2e502699c5 --- /dev/null +++ b/runtime/ftplugin/fennel.vim @@ -0,0 +1,18 @@ +" Vim filetype plugin file +" Language: Fennel +" Maintainer: Gregory Anders <greg[NOSPAM]@gpanders.com> +" Last Update: 2022 Apr 20 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal commentstring=;%s +setlocal comments=:;;,:; +setlocal formatoptions-=t +setlocal suffixesadd=.fnl +setlocal lisp +setlocal lispwords=accumulate,collect,do,doto,each,eval-compiler,fn,for,icollect,lambda,let,macro,macros,match,match-try,when,while,with-open + +let b:undo_ftplugin = 'setlocal commentstring< comments< formatoptions< suffixesadd< lisp< lispwords<' diff --git a/runtime/ftplugin/fetchmail.vim b/runtime/ftplugin/fetchmail.vim index 33bb417be4..032f6610f9 100644 --- a/runtime/ftplugin/fetchmail.vim +++ b/runtime/ftplugin/fetchmail.vim @@ -1,19 +1,16 @@ " Vim filetype plugin file -" Language: fetchmail(1) RC File -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2008-07-09 +" Language: fetchmail(1) RC File +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2022 Jun 30 if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim +setlocal comments=:# commentstring=#\ %s +setlocal formatoptions-=t formatoptions+=croql let b:undo_ftplugin = "setl com< cms< fo<" -setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/runtime/ftplugin/fortran.vim b/runtime/ftplugin/fortran.vim index 26dc90a184..8f5b243b82 100644 --- a/runtime/ftplugin/fortran.vim +++ b/runtime/ftplugin/fortran.vim @@ -1,6 +1,6 @@ " Vim settings file " Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66) -" Version: (v53) 2021 April 06 +" Version: (v53) 2021 April 06 (updated 2022 May 22) " Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/> " Usage: For instructions, do :help fortran-plugin from Vim " Credits: @@ -105,12 +105,13 @@ if !exists("b:match_words") let s:notselect = '\%(\<select\s\+\)\@<!' let s:notelse = '\%(\<end\s\+\|\<else\s\+\)\@<!' let s:notprocedure = '\%(\s\+procedure\>\)\@!' + let s:nothash = '\%(^\s*#\s*\)\@<!' let b:match_ignorecase = 1 let b:match_words = \ '(:),' . \ '\<select\s*case\>:' . s:notselect. '\<case\>:\<end\s*select\>,' . \ s:notelse . '\<if\s*(.\+)\s*then\>:' . - \ '\<else\s*\%(if\s*(.\+)\s*then\)\=\>:\<end\s*if\>,'. + \ s:nothash . '\<else\s*\%(if\s*(.\+)\s*then\)\=\>:' . s:nothash . '\<end\s*if\>,'. \ 'do\s\+\(\d\+\):\%(^\s*\)\@<=\1\s,'. \ s:notend . '\<do\>:\<end\s*do\>,'. \ s:notelse . '\<where\>:\<elsewhere\>:\<end\s*where\>,'. @@ -122,7 +123,8 @@ if !exists("b:match_words") \ s:notend . '\<subroutine\>:\<end\s*subroutine\>,'. \ s:notend . '\<function\>:\<end\s*function\>,'. \ s:notend . '\<module\>' . s:notprocedure . ':\<end\s*module\>,'. - \ s:notend . '\<program\>:\<end\s*program\>' + \ s:notend . '\<program\>:\<end\s*program\>,'. + \ '\%(^\s*\)\@<=#\s*if\%(def\|ndef\)\=\>:\%(^\s*\)\@<=#\s*\%(elif\|else\)\>:\%(^\s*\)\@<=#\s*endif\>' endif " File filters for :browse e diff --git a/runtime/ftplugin/freebasic.vim b/runtime/ftplugin/freebasic.vim index a2bb459f20..1680e84c9c 100644 --- a/runtime/ftplugin/freebasic.vim +++ b/runtime/ftplugin/freebasic.vim @@ -1,13 +1,81 @@ " Vim filetype plugin file -" Language: FreeBasic +" Language: FreeBASIC " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2015 Jan 10 +" Last Change: 2022 Jun 24 +" Setup {{{1 if exists("b:did_ftplugin") finish endif -let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim runtime! ftplugin/basic.vim -" vim: ts=8 +let s:dialect = freebasic#GetDialect() + +" Comments {{{1 +" add ''comments before 'comments +let &l:comments = "sO:*\ -,mO:*\ \ ,exO:*/,s1:/',mb:',ex:'/,:''," .. &l:comments + +" Match words {{{1 +if exists("loaded_matchit") + let s:line_start = '\%(^\s*\)\@<=' + let s:not_end = '\%(end\s\+\)\@<!' + + let b:match_words ..= ',' + + if s:dialect == 'fb' + let b:match_words ..= s:not_end .. '\<constructor\>:\<end\s\+constructor\>,' .. + \ s:not_end .. '\<destructor\>:\<end\s\+destructor\>,' .. + \ s:not_end .. '\<property\>:\<end\s\+property\>,' .. + \ s:not_end .. '\<operator\>:\<end\s\+operator\>,' .. + \ s:not_end .. '\<extern\%(\s\+"\)\@=:\<end\s\+extern\>,' + endif + + if s:dialect == 'fb' || s:dialect == 'deprecated' + let b:match_words ..= s:not_end .. '\<scope\>:\<end\s\+scope\>,' + endif + + if s:dialect == 'qb' + let b:match_words ..= s:not_end .. '\<__asm\>:\<end\s\+__asm\>,' .. + \ s:not_end .. '\<__union\>:\<end\s\+__union\>,' .. + \ s:not_end .. '\<__with\>:\<end\s\+__with\>,' + else + let b:match_words ..= s:not_end .. '\<asm\>:\<end\s\+asm\>,' .. + \ s:not_end .. '\<namespace\>:\<end\s\+namespace\>,' .. + \ s:not_end .. '\<union\>:\<end\s\+union\>,' .. + \ s:not_end .. '\<with\>:\<end\s\+with\>,' + endif + + let b:match_words ..= s:not_end .. '\<enum\>:\<end\s\+enum\>,' .. + \ s:line_start .. '#\s*\%(if\|ifdef\|ifndef\)\>:' .. + \ s:line_start .. '#\s*\%(else\|elseif\)\>:' .. + \ s:line_start .. '#\s*endif\>,' .. + \ s:line_start .. '#\s*macro\>:' .. s:line_start .. '#\s*endmacro\>,' .. + \ "/':'/" + + " skip "function = <retval>" and "continue { do | for | while }" + if s:dialect == "qb" + let s:continue = "__continue" + else + let s:continue = "continue" + endif + let b:match_skip ..= ' || strpart(getline("."), col(".") - 1) =~? "^\\<function\\s\\+="' .. + \ ' || strpart(getline("."), 0, col(".") ) =~? "\\<' .. s:continue .. '\\s\\+"' + + unlet s:not_end s:line_start +endif + +if (has("gui_win32") || has("gui_gtk")) && exists("b:basic_set_browsefilter") + let b:browsefilter = "FreeBASIC Source Files (*.bas)\t*.bas\n" .. + \ "FreeBASIC Header Files (*.bi)\t*.bi\n" .. + \ "All Files (*.*)\t*.*\n" +endif + +" Cleanup {{{1 +let &cpo = s:cpo_save +unlet s:cpo_save s:dialect + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/runtime/ftplugin/html.vim b/runtime/ftplugin/html.vim index 7579080ea5..3179aa2e88 100644 --- a/runtime/ftplugin/html.vim +++ b/runtime/ftplugin/html.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: html -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 diff --git a/runtime/ftplugin/icon.vim b/runtime/ftplugin/icon.vim new file mode 100644 index 0000000000..33a86dfb9e --- /dev/null +++ b/runtime/ftplugin/icon.vim @@ -0,0 +1,36 @@ +" Vim filetype plugin file +" Language: Icon +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2022 Jun 16 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=:# +setlocal commentstring=#\ %s +setlocal formatoptions-=t formatoptions+=croql + +let b:undo_ftplugin = "setl fo< com< cms<" + +if exists("loaded_matchit") + " let b:match_ignorecase = 0 + let b:match_words = '^\s*$\s*if\(def\|ndef\)\=\>:^\s*$\s*elif\>:^\s*$\s*else\>:^\s*$\s*endif\>,' . + \ '\<procedure\>:\<\%(initial\|return\|suspend\|fail\)\>:\<end\>' + let b:undo_ftplugin ..= " | unlet! b:match_words" +endif + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Icon Source Files (*.icn)\t*.icn\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 diff --git a/runtime/ftplugin/java.vim b/runtime/ftplugin/java.vim index 292cb6b166..74c8e8d1c1 100644 --- a/runtime/ftplugin/java.vim +++ b/runtime/ftplugin/java.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: Java -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Change: 2012 Mar 11 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 diff --git a/runtime/ftplugin/jsp.vim b/runtime/ftplugin/jsp.vim index fbba863b32..18136ccc24 100644 --- a/runtime/ftplugin/jsp.vim +++ b/runtime/ftplugin/jsp.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: jsp -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/liquid.vim b/runtime/ftplugin/liquid.vim index b211a884c6..f24ec4cbb2 100644 --- a/runtime/ftplugin/liquid.vim +++ b/runtime/ftplugin/liquid.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Liquid " Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2010 May 21 +" Last Change: 2022 Mar 15 if exists('b:did_ftplugin') finish @@ -53,7 +53,7 @@ if has('gui_win32') endif 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\>' + 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\ %} diff --git a/runtime/ftplugin/m3build.vim b/runtime/ftplugin/m3build.vim index 9e1e169d38..c910eaecd0 100644 --- a/runtime/ftplugin/m3build.vim +++ b/runtime/ftplugin/m3build.vim @@ -1,21 +1,20 @@ " Vim filetype plugin file " Language: Modula-3 Makefile " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2021 April 15 +" Last Change: 2022 June 12 if exists("b:did_ftplugin") finish endif -let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim runtime! ftplugin/m3quake.vim -if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "Modula-3 Makefile (m3makefile m3overrides)\tm3makefile;m3overrides\n" .. - \ "All Files (*.*)\t*.*\n" +if (has("gui_win32") || has("gui_gtk")) && exists("b:m3quake_set_browsefilter") + let b:browsefilter = "Modula-3 Makefile (m3makefile m3overrides)\tm3makefile;m3overrides\n" .. + \ "All Files (*.*)\t*.*\n" endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/m3quake.vim b/runtime/ftplugin/m3quake.vim index 627aabdc3e..7762875db9 100644 --- a/runtime/ftplugin/m3quake.vim +++ b/runtime/ftplugin/m3quake.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Modula-3 Quake " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2021 April 15 +" Last Change: 2022 June 12 if exists("b:did_ftplugin") finish @@ -15,18 +15,20 @@ setlocal comments=s1:/*,mb:*,ex:*/,:% setlocal commentstring=%\ %s setlocal formatoptions-=t formatoptions+=croql +let b:undo_ftplugin = "setl fo< com< cms<" + if exists("loaded_matchit") && !exists("b:match_words") let b:match_words = '\<\%(proc\|if\|foreach\)\>:\<else\>:\<end\>' + let b:undo_ftplugin ..= " | unlet! b:match_words" endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Modula-3 Quake Source Files (*.quake)\t*.quake\n" .. \ "All Files (*.*)\t*.*\n" + let b:m3quake_set_browsefilter = 1 + let b:undo_ftplugin ..= " | unlet! b:browsefilter b:m3quake_set_browsefilter" endif -let b:undo_ftplugin = "setl fo< com< cms< " .. - \ "| unlet! b:browsefilter b:match_words" - let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index fce12012b5..d7a08a9941 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -24,7 +24,11 @@ if !exists('g:no_plugin_maps') && !exists('g:no_man_maps') nnoremap <silent> <buffer> k gk nnoremap <silent> <buffer> gO :call man#show_toc()<CR> nnoremap <silent> <buffer> <2-LeftMouse> :Man<CR> - nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c + if get(b:, 'pager') + nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>q + else + nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c + endif endif if get(g:, 'ft_man_folding_enable', 0) diff --git a/runtime/ftplugin/masm.vim b/runtime/ftplugin/masm.vim index 235469ac32..ab196eb820 100644 --- a/runtime/ftplugin/masm.vim +++ b/runtime/ftplugin/masm.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Microsoft Macro Assembler (80x86) " Maintainer: Wu Yongwei <wuyongwei@gmail.com> -" Last Change: 2020-05-09 23:02:05 +0800 +" Last Change: 2022-04-24 21:24:52 +0800 if exists("b:did_ftplugin") finish @@ -15,5 +15,18 @@ let b:undo_ftplugin = "setl iskeyword<" setlocal iskeyword=@,48-57,_,36,60,62,63,@-@ +" Matchit support +if !exists('b:match_words') + let b:match_words = '^\s*\.IF\>:^\s*\.ELSEIF\>:^\s*\.ELSE\>:^\s*\.ENDIF\>,' + \ .. '^\s*\.REPEAT\>:^\s*\.UNTIL\(CXZ\)\?\>,' + \ .. '^\s*\.WHILE\>:^\s*\.ENDW\>,' + \ .. '^\s*IF\(1\|2\|E\|DEF\|NDEF\|B\|NB\|IDNI\?\|DIFI\?\)\?\>:^\s*ELSEIF\(1\|2\|E\|DEF\|NDEF\|B\|NB\|IDNI\?\|DIFI\?\)\?\>:^\s*ELSE\>:^\s*ENDIF\>,' + \ .. '\(\<MACRO\>\|^\s*%\?\s*FORC\?\>\|^\s*REPEAT\>\|^\s*WHILE\):^\s*ENDM\>,' + \ .. '\<PROC\>:\<ENDP\>,' + \ .. '\<SEGMENT\>:\<ENDS\>' + let b:match_ignorecase = 1 + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/modula3.vim b/runtime/ftplugin/modula3.vim index fc9eb57949..1f8ab359d5 100644 --- a/runtime/ftplugin/modula3.vim +++ b/runtime/ftplugin/modula3.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Modula-3 " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2021 Apr 08 +" Last Change: 2022 June 12 if exists("b:did_ftplugin") finish @@ -14,24 +14,28 @@ set cpo&vim setlocal comments=s0:(*,mb:\ ,ex:*) setlocal commentstring=(*%s*) setlocal formatoptions-=t formatoptions+=croql +setlocal suffixesadd+=.m3 +setlocal formatprg=m3pp + +let b:undo_ftplugin = "setlocal com< cms< fo< fp< sua<" if exists("loaded_matchit") && !exists("b:match_words") let b:match_words = '\<REPEAT\>:\<UNTIL\>,' .. - \ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOCK\|LOOP\|TRY\|TYPECASE\|WHILE\|WITH\)\>' .. + \ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOCK\|LOOP\|TRY\|TYPECASE\|WHILE\|WITH\|RECORD\|OBJECT\)\>' .. \ ':' .. - \ '\<\%(ELSIF\|ELSE\|EXCEPT\|FINALLY\)\>\|\%(^\s*\)\@<=\S.*=>' .. + \ '\<\%(ELSIF\|ELSE\|EXCEPT\|FINALLY\|METHODS\|OVERRIDES\)\>\|\%(^\s*\)\@<=\S.*=>' .. \ ':' .. - \ '\<END\>' + \ '\<END\>,' .. + \ '(\*:\*),<\*:\*>' + let b:undo_ftplugin ..= " | unlet! b:match_words" endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Modula-3 Source Files (*.m3)\t*.m3\n" .. \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif -let b:undo_ftplugin = "setl com< cms< fo< " .. - \ "| unlet! b:browsefilter b:match_words" - let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/pascal.vim b/runtime/ftplugin/pascal.vim index 2de92563ae..aba1e54f27 100644 --- a/runtime/ftplugin/pascal.vim +++ b/runtime/ftplugin/pascal.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Pascal " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" Previous Maintainer: Dan Sharp " Last Change: 2021 Apr 23 if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim index 603ba49502..d0bdbc0cfb 100644 --- a/runtime/ftplugin/perl.vim +++ b/runtime/ftplugin/perl.vim @@ -3,7 +3,8 @@ " Maintainer: vim-perl <vim-perl@googlegroups.com> " Homepage: https://github.com/vim-perl/vim-perl " Bugs/requests: https://github.com/vim-perl/vim-perl/issues -" Last Change: 2020 Apr 15 +" License: Vim License (see :help license) +" Last Change: 2021 Nov 10 if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 @@ -20,27 +21,36 @@ setlocal keywordprg=perldoc\ -f setlocal comments=:# setlocal commentstring=#%s -" Change the browse dialog on Win32 to show mainly Perl-related files -if has("gui_win32") - let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" . - \ "Perl Modules (*.pm)\t*.pm\n" . - \ "Perl Documentation Files (*.pod)\t*.pod\n" . - \ "All Files (*.*)\t*.*\n" -endif - " Provided by Ned Konz <ned at bike-nomad dot com> "--------------------------------------------- setlocal include=\\<\\(use\\\|require\\)\\> -setlocal includeexpr=substitute(substitute(substitute(v:fname,'::','/','g'),'->\*','',''),'$','.pm','') +" '+' is removed to support plugins in Catalyst or DBIx::Class +" where the leading plus indicates a fully-qualified module name. +setlocal includeexpr=substitute(substitute(substitute(substitute(v:fname,'+','',''),'::','/','g'),'->\*','',''),'$','.pm','') setlocal define=[^A-Za-z_] setlocal iskeyword+=: " The following line changes a global variable but is necessary to make " gf and similar commands work. Thanks to Andrew Pimlott for pointing -" out the problem. If this causes a problem for you, add an -" after/ftplugin/perl.vim file that contains -" set isfname-=: +" out the problem. +let s:old_isfname = &isfname set isfname+=: +let s:new_isfname = &isfname + +augroup perl_global_options + au! + exe "au BufEnter * if &filetype == 'perl' | let &isfname = '" . s:new_isfname . "' | endif" + exe "au BufLeave * if &filetype == 'perl' | let &isfname = '" . s:old_isfname . "' | endif" +augroup END + +" Undo the stuff we changed. +let b:undo_ftplugin = "setlocal fo< kp< com< cms< inc< inex< def< isk<" . + \ " | let &isfname = '" . s:old_isfname . "'" + +if get(g:, 'perl_fold', 0) + setlocal foldmethod=syntax + let b:undo_ftplugin .= " | setlocal fdm<" +endif " Set this once, globally. if !exists("perlpath") @@ -74,16 +84,26 @@ if &l:path == "" else let &l:path=&l:path.",".perlpath endif + +let b:undo_ftplugin .= " | setlocal pa<" "--------------------------------------------- -" Undo the stuff we changed. -let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk< isf< kp< path<" . - \ " | unlet! b:browsefilter" +" Change the browse dialog to show mainly Perl-related files +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" . + \ "Perl Modules (*.pm)\t*.pm\n" . + \ "Perl Documentation Files (*.pod)\t*.pod\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" +endif -" proper matching for matchit plugin -let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField' -let b:match_words = '\<if\>:\<elsif\>:\<else\>' +" Proper matching for matchit plugin +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField' + let b:match_words = '\<if\>:\<elsif\>:\<else\>' + let b:undo_ftplugin .= " | unlet! b:match_words b:match_skip" +endif " Restore the saved compatibility options. let &cpo = s:save_cpo -unlet s:save_cpo +unlet s:save_cpo s:old_isfname s:new_isfname diff --git a/runtime/ftplugin/php.vim b/runtime/ftplugin/php.vim index a2f8b4d8d3..2824a5853b 100644 --- a/runtime/ftplugin/php.vim +++ b/runtime/ftplugin/php.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: php -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif @@ -71,10 +73,11 @@ exe 'nno <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>' exe 'ono <buffer> <silent> [[ ?' . escape(s:section, '|') . '?<CR>:nohls<CR>' exe 'ono <buffer> <silent> ]] /' . escape(s:section, '|') . '/<CR>:nohls<CR>' +setlocal suffixesadd=.php setlocal commentstring=/*%s*/ " Undo the stuff we changed. -let b:undo_ftplugin = "setlocal commentstring< include< omnifunc<" . +let b:undo_ftplugin = "setlocal suffixesadd< commentstring< include< omnifunc<" . \ " | unlet! b:browsefilter b:match_words | " . \ s:undo_ftplugin diff --git a/runtime/ftplugin/pod.vim b/runtime/ftplugin/pod.vim new file mode 100644 index 0000000000..2a905ab354 --- /dev/null +++ b/runtime/ftplugin/pod.vim @@ -0,0 +1,71 @@ +" Vim filetype plugin file +" Language: Perl POD format +" Maintainer: vim-perl <vim-perl@googlegroups.com> +" Author: Doug Kearns <dougkearns@gmail.com> +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2021 Oct 19 + +if exists("b:did_ftplugin") + finish +endif + +let s:save_cpo = &cpo +set cpo-=C + +setlocal comments=fb:=for\ comment +setlocal commentstring==for\ comment\ %s + +let b:undo_ftplugin = "setl com< cms<" + +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_words = + \ '^=pod\>:^=cut\>,' . + \ '^=begin\s\+\(\S\+\):^=end\s\+\1,' . + \ '^=over\>:^=item\>:^=back\>,' . + \ '[IBCLEFSXZ]<<\%(\s\+\|$\)\@=:\%(\s\+\|^\)\@<=>>,' . + \ '[IBCLEFSXZ]<:>' + let b:undo_ftplugin .= " | unlet! b:match_words" +endif + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "POD Source Files (*.pod)\t*.pod\n" . + \ "Perl Source Files (*.pl)\t*.pl\n" . + \ "Perl Modules (*.pm)\t*.pm\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" +endif + +function! s:jumpToSection(backwards) + let flags = a:backwards ? 'bsWz' : 'sWz' + if has('syntax_items') + let skip = "synIDattr(synID(line('.'), col('.'), 1), 'name') !~# '\\<podCommand\\>'" + else + let skip = '' + endif + for i in range(v:count1) + call search('^=\a', flags, 0, 0, skip) + endfor +endfunction + +if !exists("no_plugin_maps") && !exists("no_pod_maps") + nnoremap <silent> <buffer> ]] <Cmd>call <SID>jumpToSection()<CR> + vnoremap <silent> <buffer> ]] <Cmd>call <SID>jumpToSection()<CR> + nnoremap <silent> <buffer> ][ <Cmd>call <SID>jumpToSection()<CR> + vnoremap <silent> <buffer> ][ <Cmd>call <SID>jumpToSection()<CR> + nnoremap <silent> <buffer> [[ <Cmd>call <SID>jumpToSection(1)<CR> + vnoremap <silent> <buffer> [[ <Cmd>call <SID>jumpToSection(1)<CR> + nnoremap <silent> <buffer> [] <Cmd>call <SID>jumpToSection(1)<CR> + vnoremap <silent> <buffer> [] <Cmd>call <SID>jumpToSection(1)<CR> + let b:undo_ftplugin .= + \ " | silent! exe 'nunmap <buffer> ]]' | silent! exe 'vunmap <buffer> ]]'" . + \ " | silent! exe 'nunmap <buffer> ][' | silent! exe 'vunmap <buffer> ]['" . + \ " | silent! exe 'nunmap <buffer> ]]' | silent! exe 'vunmap <buffer> ]]'" . + \ " | silent! exe 'nunmap <buffer> []' | silent! exe 'vunmap <buffer> []'" +endif + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set expandtab: diff --git a/runtime/ftplugin/qb64.vim b/runtime/ftplugin/qb64.vim new file mode 100644 index 0000000000..0fa36fc3d2 --- /dev/null +++ b/runtime/ftplugin/qb64.vim @@ -0,0 +1,26 @@ +" Vim filetype plugin file +" Language: QB64 +" Maintainer: Doug Kearns <dougkearns@gmail.com> + +if exists("b:did_ftplugin") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +runtime! ftplugin/basic.vim + +let s:not_end = '\%(end\s\+\)\@<!' + +let b:match_words ..= ',' .. + \ s:not_end .. '\<declare\>:\<end\s\+declare\>,' .. + \ '\<select\s\+everycase\>:\%(select\s\+\)\@<!\<case\%(\s\+\%(else\|is\)\)\=\>:\<end\s\+select\>,' .. + \ '$IF\>:$\%(ELSEIF\|ELSE\)\>:$END\s*IF\>' + +unlet s:not_end + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua new file mode 100644 index 0000000000..3b99d67247 --- /dev/null +++ b/runtime/ftplugin/query.lua @@ -0,0 +1,6 @@ +-- Neovim filetype plugin file +-- Language: Tree-sitter query +-- Last Change: 2022 Mar 29 + +-- it's a lisp! +vim.cmd([[ runtime! ftplugin/lisp.vim ]]) diff --git a/runtime/ftplugin/reva.vim b/runtime/ftplugin/reva.vim index 05c8bc3250..29ecab0d0a 100644 --- a/runtime/ftplugin/reva.vim +++ b/runtime/ftplugin/reva.vim @@ -1,7 +1,7 @@ " Vim ftplugin file " Language: Reva Forth " Version: 7.1 -" Last Change: 2008/01/11 +" Last Change: 2022 Apr 27 " Maintainer: Ron Aaron <ron@ronware.org> " URL: http://ronware.org/reva/ " Filetypes: *.rf *.frt @@ -23,3 +23,5 @@ setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\ setlocal fo=tcrqol setlocal matchpairs+=\::; setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 + +let b:undo_ftplugin = "setlocal sts< sw< com< fo< mps< isk<" diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index 4a476fd8cf..8c1f47731c 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -3,7 +3,7 @@ " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2020 Feb 13 +" Last Change: 2022 Mar 21 if (exists("b:did_ftplugin")) finish @@ -53,7 +53,7 @@ endif " TODO: "setlocal define=^\\s*def -setlocal comments=:# +setlocal comments=b:# setlocal commentstring=#\ %s if !exists('g:ruby_version_paths') @@ -87,8 +87,14 @@ endfunction function! s:build_path(path) abort let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',') - if &g:path !~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$' - let path = substitute(&g:path,',,$',',','') . ',' . path + if &g:path =~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$' + let path = path . ',.,,' + elseif &g:path =~# ',\.,,$' + let path = &g:path[0:-4] . path . ',.,,' + elseif &g:path =~# ',,$' + let path = &g:path[0:-2] . path . ',,' + else + let path = substitute(&g:path, '[^,]\zs$', ',', '') . path endif return path endfunction @@ -164,6 +170,8 @@ let b:undo_ftplugin .= "| sil! cunmap <buffer> <Plug><ctag>| sil! cunmap <buffer if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps") nmap <buffer><script> <SID>: :<C-U> nmap <buffer><script> <SID>c: :<C-U><C-R>=v:count ? v:count : ''<CR> + cmap <buffer> <SID><cfile> <Plug><cfile> + cmap <buffer> <SID><ctag> <Plug><ctag> nnoremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'b','n')<CR> nnoremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>',['rubyDefine'],'','n')<CR> @@ -210,20 +218,20 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps") call s:map('c', '', '<C-R><C-F> <Plug><cfile>') cmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? '<Bar>norm! zv' : '' - call s:map('n', '<silent>', '<C-]> <SID>:exe v:count1."tag <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', 'g<C-]> <SID>:exe "tjump <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', 'g] <SID>:exe "tselect <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', '<C-W>] <SID>:exe v:count1."stag <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', '<C-W><C-]> <SID>:exe v:count1."stag <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:exe "stjump <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', '<C-W>g] <SID>:exe "stselect <Plug><ctag>"<SID>tagzv<CR>') - call s:map('n', '<silent>', '<C-W>} <SID>:exe v:count1."ptag <Plug><ctag>"<CR>') - call s:map('n', '<silent>', '<C-W>g} <SID>:exe "ptjump <Plug><ctag>"<CR>') - - call s:map('n', '<silent>', 'gf <SID>c:find <Plug><cfile><CR>') - call s:map('n', '<silent>', '<C-W>f <SID>c:sfind <Plug><cfile><CR>') - call s:map('n', '<silent>', '<C-W><C-F> <SID>c:sfind <Plug><cfile><CR>') - call s:map('n', '<silent>', '<C-W>gf <SID>c:tabfind <Plug><cfile><CR>') + call s:map('n', '<script><silent>', '<C-]> <SID>:exe v:count1."tag <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', 'g<C-]> <SID>:exe "tjump <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', 'g] <SID>:exe "tselect <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', '<C-W>] <SID>:exe v:count1."stag <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', '<C-W><C-]> <SID>:exe v:count1."stag <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', '<C-W>g<C-]> <SID>:exe "stjump <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', '<C-W>g] <SID>:exe "stselect <SID><ctag>"<SID>tagzv<CR>') + call s:map('n', '<script><silent>', '<C-W>} <SID>:exe v:count1."ptag <SID><ctag>"<CR>') + call s:map('n', '<script><silent>', '<C-W>g} <SID>:exe "ptjump <SID><ctag>"<CR>') + + call s:map('n', '<script><silent>', 'gf <SID>c:find <SID><cfile><CR>') + call s:map('n', '<script><silent>', '<C-W>f <SID>c:sfind <SID><cfile><CR>') + call s:map('n', '<script><silent>', '<C-W><C-F> <SID>c:sfind <SID><cfile><CR>') + call s:map('n', '<script><silent>', '<C-W>gf <SID>c:tabfind <SID><cfile><CR>') endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/scdoc.vim b/runtime/ftplugin/scdoc.vim index 2e98e647f4..552c865baa 100644 --- a/runtime/ftplugin/scdoc.vim +++ b/runtime/ftplugin/scdoc.vim @@ -1,6 +1,7 @@ " scdoc filetype plugin -" Maintainer: Gregory Anders <greg@gpanders.com> -" Last Updated: 2021-08-04 +" Maintainer: Gregory Anders <contact@gpanders.com> +" Last Updated: 2022-05-09 +" Upstream: https://github.com/gpanders/vim-scdoc " Only do this when not done yet for this buffer if exists('b:did_ftplugin') @@ -19,8 +20,3 @@ setlocal softtabstop=0 setlocal textwidth=80 let b:undo_ftplugin = 'setl com< cms< fo< et< sw< sts< tw<' - -if has('conceal') - setlocal conceallevel=2 - let b:undo_ftplugin .= ' cole<' -endif diff --git a/runtime/ftplugin/sgml.vim b/runtime/ftplugin/sgml.vim index bf63efbf1f..ef52125c68 100644 --- a/runtime/ftplugin/sgml.vim +++ b/runtime/ftplugin/sgml.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: sgml -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim index 593fcec927..93a46f63e2 100644 --- a/runtime/ftplugin/sh.vim +++ b/runtime/ftplugin/sh.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: sh -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim index ce00021a69..9040e19ce1 100644 --- a/runtime/ftplugin/spec.vim +++ b/runtime/ftplugin/spec.vim @@ -3,6 +3,7 @@ " 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 if exists("b:did_ftplugin") finish @@ -41,8 +42,8 @@ else: headers = spec.sourceHeader version = headers["Version"] release = headers["Release"] - vim.command("let ver = " + version) - vim.command("let rel = " + release) + vim.command("let ver = '" + version + "'") + vim.command("let rel = '" + release + "'") PYEND endif endfunction diff --git a/runtime/ftplugin/svg.vim b/runtime/ftplugin/svg.vim index 8fff6ea32c..6f16b1a0f4 100644 --- a/runtime/ftplugin/svg.vim +++ b/runtime/ftplugin/svg.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: svg -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/tap.vim b/runtime/ftplugin/tap.vim new file mode 100644 index 0000000000..c165c0ce68 --- /dev/null +++ b/runtime/ftplugin/tap.vim @@ -0,0 +1,27 @@ +" Vim filetype plugin file +" Language: Verbose TAP Output +" Maintainer: vim-perl <vim-perl@googlegroups.com> +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2021 Oct 22 + +" Only do this when not done yet for this buffer +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal foldtext=TAPTestLine_foldtext() +function! TAPTestLine_foldtext() + let line = getline(v:foldstart) + let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g') + return sub +endfunction + +setlocal foldminlines=5 +setlocal foldcolumn=2 +setlocal foldenable +setlocal foldmethod=syntax + +let b:undo_ftplugin = 'setlocal foldtext< foldminlines< foldcolumn< foldenable< foldmethod<' diff --git a/runtime/ftplugin/tcsh.vim b/runtime/ftplugin/tcsh.vim index 33f1aabf68..85d3873b33 100644 --- a/runtime/ftplugin/tcsh.vim +++ b/runtime/ftplugin/tcsh.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: tcsh " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" Previous Maintainer: Dan Sharp " Last Change: 2021 Oct 15 if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/tt2html.vim b/runtime/ftplugin/tt2html.vim index 10520d8064..0407dbba4e 100644 --- a/runtime/ftplugin/tt2html.vim +++ b/runtime/ftplugin/tt2html.vim @@ -1,8 +1,10 @@ +" Vim filetype plugin file " Language: TT2 embedded with HTML " Maintainer: vim-perl <vim-perl@googlegroups.com> -" Homepage: http://github.com/vim-perl/vim-perl -" Bugs/requests: http://github.com/vim-perl/vim-perl/issues -" Last Change: 2013-07-21 +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2018 Mar 28 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/vue.vim b/runtime/ftplugin/vue.vim new file mode 100644 index 0000000000..e8833742ad --- /dev/null +++ b/runtime/ftplugin/vue.vim @@ -0,0 +1,24 @@ +" Vim filetype plugin file +" Language: vue + +if exists("b:did_ftplugin") | finish | endif +let b:did_ftplugin = 1 + +" Make sure the continuation lines below do not cause problems in +" compatibility mode. +let s:save_cpo = &cpo +set cpo-=C + +" Copied from ftplugin/html.vim +" Original thanks to Johannes Zellner and Benji Fisher. +if exists("loaded_matchit") + let b:match_ignorecase = 1 + let b:match_words = '<:>,' + \ .. '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' + \ .. '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' + \ .. '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' +endif + +" Restore the saved compatibility options. +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/runtime/ftplugin/wget.vim b/runtime/ftplugin/wget.vim new file mode 100644 index 0000000000..7a10221824 --- /dev/null +++ b/runtime/ftplugin/wget.vim @@ -0,0 +1,29 @@ +" Vim filetype plugin file +" Language: Wget configuration file (/etc/wgetrc ~/.wgetrc) +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2022 Apr 28 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=:#,:// +setlocal commentstring=#\ %s +setlocal formatoptions-=t formatoptions+=croql + +let b:undo_ftplugin = "setl fo< com< cms<" + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Wget Configuration File (wgetrc, .wgetrc)\twgetrc;.wgetrc\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 diff --git a/runtime/ftplugin/wget2.vim b/runtime/ftplugin/wget2.vim new file mode 100644 index 0000000000..a6845f6df5 --- /dev/null +++ b/runtime/ftplugin/wget2.vim @@ -0,0 +1,29 @@ +" Vim filetype plugin file +" Language: Wget2 configuration file (/etc/wget2rc ~/.wget2rc) +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2022 Apr 28 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=:#,:// +setlocal commentstring=#\ %s +setlocal formatoptions-=t formatoptions+=croql + +let b:undo_ftplugin = "setl fo< com< cms<" + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Wget2 Configuration File (wget2rc, .wget2rc)\twget2rc;.wget2rc\n" . + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 diff --git a/runtime/ftplugin/xhtml.vim b/runtime/ftplugin/xhtml.vim index 21ed3e1100..d2a1c0b566 100644 --- a/runtime/ftplugin/xhtml.vim +++ b/runtime/ftplugin/xhtml.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: xhtml -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/xml.vim b/runtime/ftplugin/xml.vim index 1d43521155..9aa188cecc 100644 --- a/runtime/ftplugin/xml.vim +++ b/runtime/ftplugin/xml.vim @@ -3,7 +3,7 @@ " Maintainer: Christian Brabandt <cb@256bit.org> " Last Changed: Dec 07th, 2018 " Repository: https://github.com/chrisbra/vim-xml-ftplugin -" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" Previous Maintainer: Dan Sharp " URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/xs.vim b/runtime/ftplugin/xs.vim index a28da6aa1e..206fbc2713 100644 --- a/runtime/ftplugin/xs.vim +++ b/runtime/ftplugin/xs.vim @@ -1,9 +1,10 @@ " Vim filetype plugin file " Language: XS (Perl extension interface language) " Maintainer: vim-perl <vim-perl@googlegroups.com> -" Homepage: http://github.com/vim-perl/vim-perl -" Bugs/requests: http://github.com/vim-perl/vim-perl/issues -" Last Change: 2013-07-21 +" Homepage: https://github.com/vim-perl/vim-perl +" Bugs/requests: https://github.com/vim-perl/vim-perl/issues +" License: Vim License (see :help license) +" Last Change: 2018 Mar 28 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/xsd.vim b/runtime/ftplugin/xsd.vim index 6a4a193656..7d3efbb390 100644 --- a/runtime/ftplugin/xsd.vim +++ b/runtime/ftplugin/xsd.vim @@ -1,8 +1,10 @@ " Vim filetype plugin file " Language: xsd -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> +" +" This runtime file is looking for a new maintainer. +" +" Former maintainer: Dan Sharp " Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif diff --git a/runtime/ftplugin/xslt.vim b/runtime/ftplugin/xslt.vim index 1a5ee62865..47e78eb81d 100644 --- a/runtime/ftplugin/xslt.vim +++ b/runtime/ftplugin/xslt.vim @@ -1,16 +1,18 @@ " Vim filetype plugin file -" Language: xslt -" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net> -" Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin +" Language: XSLT +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Dan Sharp +" Last Change: 2022 Apr 25 -if exists("b:did_ftplugin") | finish | endif +if exists("b:did_ftplugin") + finish +endif runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim let b:did_ftplugin = 1 " Change the :browse e filter to primarily show xsd-related files. -if has("gui_win32") && exists("b:browsefilter") - let b:browsefilter="XSLT Files (*.xsl,*.xslt)\t*.xsl;*.xslt\n" . b:browsefilter +if (has("gui_win32") || has("gui_gtk")) && exists("b:browsefilter") + let b:browsefilter = "XSLT Files (*.xsl,*.xslt)\t*.xsl;*.xslt\n" . b:browsefilter endif |