From af0eaee01737d26314c9c3618153e99d1eb3e2f1 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 1 Jun 2021 18:17:40 +0200 Subject: Update --- ftplugin/elixir.vim | 9 ++++---- ftplugin/git.vim | 2 +- ftplugin/julia.vim | 2 +- ftplugin/meson.vim | 1 + ftplugin/modula2.vim | 43 ++++++++++++++++++++++++++++++++++++++ ftplugin/modula3.vim | 42 +++++++++++++++++++++++++++++++++++++ ftplugin/pascal.vim | 52 ++++++++++++++++++++++++++++++++++++---------- ftplugin/rmd.vim | 4 ++-- ftplugin/rnoweb.vim | 4 ++-- ftplugin/rrst.vim | 4 ++-- ftplugin/systemverilog.vim | 35 ++++++++++++++++++++++++++++++- ftplugin/vlang.vim | 2 +- 12 files changed, 175 insertions(+), 25 deletions(-) create mode 100644 ftplugin/modula2.vim create mode 100644 ftplugin/modula3.vim (limited to 'ftplugin') diff --git a/ftplugin/elixir.vim b/ftplugin/elixir.vim index 4ab896db..cd25464a 100644 --- a/ftplugin/elixir.vim +++ b/ftplugin/elixir.vim @@ -25,10 +25,11 @@ setlocal commentstring=#\ %s let &l:path = \ join([ - \ 'lib', - \ 'src', - \ 'deps/**/lib', - \ 'deps/**/src', + \ 'lib/**', + \ 'src/**', + \ 'test/**', + \ 'deps/**/lib/**', + \ 'deps/**/src/**', \ &g:path \ ], ',') setlocal includeexpr=elixir#util#get_filename(v:fname) diff --git a/ftplugin/git.vim b/ftplugin/git.vim index 072859ed..9a5ac16c 100644 --- a/ftplugin/git.vim +++ b/ftplugin/git.vim @@ -37,7 +37,7 @@ if exists('*shellescape') && exists('b:git_dir') && b:git_dir != '' else setlocal keywordprg=git\ show endif -if has('gui_running') +if has('gui_running') && &guioptions !~# '!' let &l:keywordprg = substitute(&l:keywordprg,'^git\>','git --no-pager','') endif diff --git a/ftplugin/julia.vim b/ftplugin/julia.vim index 08aa2f8e..785ffa2a 100644 --- a/ftplugin/julia.vim +++ b/ftplugin/julia.vim @@ -83,7 +83,7 @@ if exists("loaded_matchit") " the 'begin' and 'end' keywords when they are used as a range rather than as " the delimiter of a block let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") =~ ' - \ . '"\\"' + \ . '"\\"' let b:undo_ftplugin = b:undo_ftplugin \ . " | unlet! b:match_words b:match_skip b:match_ignorecase" diff --git a/ftplugin/meson.vim b/ftplugin/meson.vim index 6074dbd3..79ff47c6 100644 --- a/ftplugin/meson.vim +++ b/ftplugin/meson.vim @@ -5,6 +5,7 @@ endif " Vim filetype plugin file " Language: meson " License: VIM License +" Maintainer: Liam Beguin " Original Author: Laurent Pinchart " Last Change: 2018 Nov 27 diff --git a/ftplugin/modula2.vim b/ftplugin/modula2.vim new file mode 100644 index 00000000..a61d0bd1 --- /dev/null +++ b/ftplugin/modula2.vim @@ -0,0 +1,43 @@ +if polyglot#init#is_disabled(expand(':p'), 'modula2', 'ftplugin/modula2.vim') + finish +endif + +" Vim filetype plugin file +" Language: Modula-2 +" Maintainer: Doug Kearns +" Last Change: 2021 Apr 08 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=s0:(*,mb:\ ,ex:*) +setlocal commentstring=(*%s*) +setlocal formatoptions-=t formatoptions+=croql + +if exists("loaded_matchit") && !exists("b:match_words") + " The second branch of the middle pattern is intended to match CASE labels + let b:match_words = '\:\,' .. + \ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOOP\|WHILE\|WITH\)\>' .. + \ ':' .. + \ '\<\%(ELSIF\|ELSE\)\>\|\%(^\s*\)\@<=\w\+\%(\s*\,\s*\w\+\)\=\s*\:=\@!' .. + \ ':' .. + \ '\' +endif + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Modula-2 Source Files (*.def *.mod)\t*.def;*.mod\n" .. + \ "All Files (*.*)\t*.*\n" +endif + +let b:undo_ftplugin = "setl com< cms< fo< " .. + \ "| unlet! b:browsefilter b:match_words" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/ftplugin/modula3.vim b/ftplugin/modula3.vim new file mode 100644 index 00000000..1e9fc10e --- /dev/null +++ b/ftplugin/modula3.vim @@ -0,0 +1,42 @@ +if polyglot#init#is_disabled(expand(':p'), 'modula3', 'ftplugin/modula3.vim') + finish +endif + +" Vim filetype plugin file +" Language: Modula-3 +" Maintainer: Doug Kearns +" Last Change: 2021 Apr 08 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=s0:(*,mb:\ ,ex:*) +setlocal commentstring=(*%s*) +setlocal formatoptions-=t formatoptions+=croql + +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_words = '\:\,' .. + \ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOCK\|LOOP\|TRY\|TYPECASE\|WHILE\|WITH\)\>' .. + \ ':' .. + \ '\<\%(ELSIF\|ELSE\|EXCEPT\|FINALLY\)\>\|\%(^\s*\)\@<=\S.*=>' .. + \ ':' .. + \ '\' +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" +endif + +let b:undo_ftplugin = "setl com< cms< fo< " .. + \ "| unlet! b:browsefilter b:match_words" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/ftplugin/pascal.vim b/ftplugin/pascal.vim index db3da051..5b0640e7 100644 --- a/ftplugin/pascal.vim +++ b/ftplugin/pascal.vim @@ -3,22 +3,52 @@ if polyglot#init#is_disabled(expand(':p'), 'pascal', 'ftplugin/pascal.vim endif " Vim filetype plugin file -" Language: pascal -" Maintainer: Dan Sharp -" Last Changed: 11 Apr 2011 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin +" Language: Pascal +" Maintainer: Doug Kearns +" Previous Maintainer: Dan Sharp +" Last Change: 2021 Apr 23 if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 +let s:cpo_save = &cpo +set cpo&vim + +set comments=s:(*,m:\ ,e:*),s:{,m:\ ,e:} +set commentstring={%s} + +if exists("pascal_delphi") + set comments+=:/// +endif + +if !exists("pascal_traditional") + set commentstring=//\ %s + set comments+=:// +endif + +setlocal formatoptions-=t formatoptions+=croql + if exists("loaded_matchit") - let b:match_ignorecase = 1 " (pascal is case-insensitive) + let b:match_ignorecase = 1 " (Pascal is case-insensitive) + + let b:match_words = '\<\%(asm\|begin\|case\|\%(\%(=\|packed\)\s*\)\@<=\%(class\|object\)\|\%(=\s*\)\@<=interface\|record\|try\)\>' + let b:match_words .= ':\%(^\s*\)\@<=\%(except\|finally\|else\|otherwise\)\>' + let b:match_words .= ':\\.\@!' + + let b:match_words .= ',\:\' + " let b:match_words .= ',\:\' " FIXME - else clashing with middle else. It seems like a debatable use anyway. + let b:match_words .= ',\:\<\%(\%(^\s*\)\@<=interface\|implementation\|initialization\|finalization\)\>:\ " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sun Jul 22, 2018 06:51PM +" Last Change: Sat Aug 15, 2020 12:03PM " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann) " Only do this when not yet done for this buffer @@ -50,7 +50,7 @@ runtime ftplugin/pandoc.vim " Don't load another plugin for this buffer let b:did_ftplugin = 1 -if has("gui_win32") && !exists("b:browsefilter") +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . \ "All Files (*.*)\t*.*\n" endif diff --git a/ftplugin/rnoweb.vim b/ftplugin/rnoweb.vim index 13b68ef7..ab6389f9 100644 --- a/ftplugin/rnoweb.vim +++ b/ftplugin/rnoweb.vim @@ -6,7 +6,7 @@ endif " Language: Rnoweb " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Tue Apr 07, 2015 04:37PM +" Last Change: Sat Aug 15, 2020 12:02PM " Only do this when not yet done for this buffer if exists("b:did_ftplugin") @@ -28,7 +28,7 @@ setlocal iskeyword=@,48-57,_,. setlocal suffixesadd=.bib,.tex setlocal comments=b:%,b:#,b:##,b:###,b:#' -if has("gui_win32") && !exists("b:browsefilter") +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . \ "All Files (*.*)\t*.*\n" endif diff --git a/ftplugin/rrst.vim b/ftplugin/rrst.vim index 68661a65..25ca0dc7 100644 --- a/ftplugin/rrst.vim +++ b/ftplugin/rrst.vim @@ -6,7 +6,7 @@ endif " Language: reStructuredText documentation format with R code " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Wed Nov 01, 2017 10:47PM +" Last Change: Sat Aug 15, 2020 12:02PM " Original work by Alex Zvoleff " Only do this when not yet done for this buffer @@ -41,7 +41,7 @@ if !exists("g:rrst_dynamic_comments") || (exists("g:rrst_dynamic_comments") && g setlocal formatexpr=FormatRrst() endif -if has("gui_win32") && !exists("b:browsefilter") +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . \ "All Files (*.*)\t*.*\n" endif diff --git a/ftplugin/systemverilog.vim b/ftplugin/systemverilog.vim index c0959e48..53bd1351 100644 --- a/ftplugin/systemverilog.vim +++ b/ftplugin/systemverilog.vim @@ -5,7 +5,7 @@ endif " Vim filetype plugin file " Language: SystemVerilog " Maintainer: kocha -" Last Change: 12-Aug-2013. +" Last Change: 07-May-2021 if exists("b:did_ftplugin") finish @@ -13,3 +13,36 @@ endif " Behaves just like Verilog runtime! ftplugin/verilog.vim + +let s:cpo_save = &cpo +set cpo&vim + +" Add SystemVerilog keywords for matchit plugin. +if exists("loaded_matchit") + let b:match_words = + \ '\:\,' . + \ '\\|\\|\:\,' . + \ '\:\,' . + \ '\:`\@,' . + \ '\:\,' . + \ '`ifn\?def\>:`elsif\>:`else\>:`endif\>,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\\|\\|\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\,' . + \ '\:\' +endif + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/ftplugin/vlang.vim b/ftplugin/vlang.vim index fbc0a711..2ae86f99 100644 --- a/ftplugin/vlang.vim +++ b/ftplugin/vlang.vim @@ -24,7 +24,7 @@ function! _VFormatFile() else let [_, lnum, colnum, _] = getpos('.') %delete - call append(0, split(substitution, "\n")) + call setline(1, split(substitution, "\n")) call cursor(lnum, colnum) endif endif -- cgit v1.2.3