diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2021-03-01 13:44:50 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2021-03-01 13:44:50 +0100 |
commit | cc63193ce82c1e7b9ee2ad7d0ddd14e8394211ef (patch) | |
tree | 260360b1a32ca19635f8c8884b81fcec9ed51168 /ftplugin | |
parent | 4c10562d2cc9b084518284c49a158558da5180a7 (diff) | |
download | vim-polyglot-cc63193ce82c1e7b9ee2ad7d0ddd14e8394211ef.tar.gz vim-polyglot-cc63193ce82c1e7b9ee2ad7d0ddd14e8394211ef.zip |
Update
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/ada.vim | 69 | ||||
-rw-r--r-- | ftplugin/basic.vim | 31 | ||||
-rw-r--r-- | ftplugin/bzl.vim | 4 | ||||
-rw-r--r-- | ftplugin/epuppet.vim (renamed from ftplugin/embeddedpuppet.vim) | 2 | ||||
-rw-r--r-- | ftplugin/framescript.vim | 6 | ||||
-rw-r--r-- | ftplugin/freebasic.vim | 17 | ||||
-rw-r--r-- | ftplugin/hamster.vim | 7 | ||||
-rw-r--r-- | ftplugin/lisp.vim | 4 | ||||
-rw-r--r-- | ftplugin/octave.vim | 5 | ||||
-rw-r--r-- | ftplugin/rust.vim | 2 | ||||
-rw-r--r-- | ftplugin/sxhkdrc.vim | 10 | ||||
-rw-r--r-- | ftplugin/tidy.vim | 36 | ||||
-rw-r--r-- | ftplugin/vlang.vim | 31 | ||||
-rw-r--r-- | ftplugin/zig.vim | 8 |
14 files changed, 185 insertions, 47 deletions
diff --git a/ftplugin/ada.vim b/ftplugin/ada.vim index d7b34be0..bddd43b6 100644 --- a/ftplugin/ada.vim +++ b/ftplugin/ada.vim @@ -163,40 +163,41 @@ if exists("g:ada_abbrev") endif " Section: Commands, Mapping, Menus {{{1 -" -call ada#Map_Popup ( - \ 'Tag.List', - \ 'l', - \ 'call ada#List_Tag ()') -call ada#Map_Popup ( - \'Tag.Jump', - \'j', - \'call ada#Jump_Tag ()') -call ada#Map_Menu ( - \'Tag.Create File', - \':AdaTagFile', - \'call ada#Create_Tags (''file'')') -call ada#Map_Menu ( - \'Tag.Create Dir', - \':AdaTagDir', - \'call ada#Create_Tags (''dir'')') - -call ada#Map_Menu ( - \'Highlight.Toggle Space Errors', - \ ':AdaSpaces', - \'call ada#Switch_Syntax_Option (''space_errors'')') -call ada#Map_Menu ( - \'Highlight.Toggle Lines Errors', - \ ':AdaLines', - \'call ada#Switch_Syntax_Option (''line_errors'')') -call ada#Map_Menu ( - \'Highlight.Toggle Rainbow Color', - \ ':AdaRainbow', - \'call ada#Switch_Syntax_Option (''rainbow_color'')') -call ada#Map_Menu ( - \'Highlight.Toggle Standard Types', - \ ':AdaTypes', - \'call ada#Switch_Syntax_Option (''standard_types'')') +if !exists(':AdaTagFile') + call ada#Map_Popup ( + \ 'Tag.List', + \ 'l', + \ 'call ada#List_Tag ()') + call ada#Map_Popup ( + \'Tag.Jump', + \'j', + \'call ada#Jump_Tag ()') + call ada#Map_Menu ( + \'Tag.Create File', + \':AdaTagFile', + \'call ada#Create_Tags (''file'')') + call ada#Map_Menu ( + \'Tag.Create Dir', + \':AdaTagDir', + \'call ada#Create_Tags (''dir'')') + + call ada#Map_Menu ( + \'Highlight.Toggle Space Errors', + \ ':AdaSpaces', + \'call ada#Switch_Syntax_Option (''space_errors'')') + call ada#Map_Menu ( + \'Highlight.Toggle Lines Errors', + \ ':AdaLines', + \'call ada#Switch_Syntax_Option (''line_errors'')') + call ada#Map_Menu ( + \'Highlight.Toggle Rainbow Color', + \ ':AdaRainbow', + \'call ada#Switch_Syntax_Option (''rainbow_color'')') + call ada#Map_Menu ( + \'Highlight.Toggle Standard Types', + \ ':AdaTypes', + \'call ada#Switch_Syntax_Option (''standard_types'')') +endif " 1}}} " Reset cpoptions diff --git a/ftplugin/basic.vim b/ftplugin/basic.vim new file mode 100644 index 00000000..016253f6 --- /dev/null +++ b/ftplugin/basic.vim @@ -0,0 +1,31 @@ +if polyglot#init#is_disabled(expand('<sfile>:p'), 'basic', 'ftplugin/basic.vim') + finish +endif + +" Vim filetype plugin file +" Language: BASIC +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2015 Jan 10 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=: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" +endif + +let b:undo_ftplugin = "setl fo< com< cms< sua<" . + \ " | unlet! b:browsefilter" + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/ftplugin/bzl.vim b/ftplugin/bzl.vim index b1ece99b..c6add72a 100644 --- a/ftplugin/bzl.vim +++ b/ftplugin/bzl.vim @@ -5,7 +5,7 @@ endif " Vim filetype plugin file " Language: Bazel (http://bazel.io) " Maintainer: David Barnett (https://github.com/google/vim-ft-bzl) -" Last Change: 2015 Aug 11 +" Last Change: 2021 Jan 19 "" " @section Introduction, intro @@ -55,6 +55,8 @@ if get(g:, 'ft_bzl_fold', 0) endif if exists('*BzlFoldText') + let &cpo = s:save_cpo + unlet s:save_cpo finish endif diff --git a/ftplugin/embeddedpuppet.vim b/ftplugin/epuppet.vim index 7a2621fb..482d2af1 100644 --- a/ftplugin/embeddedpuppet.vim +++ b/ftplugin/epuppet.vim @@ -1,4 +1,4 @@ -if polyglot#init#is_disabled(expand('<sfile>:p'), 'puppet', 'ftplugin/embeddedpuppet.vim') +if polyglot#init#is_disabled(expand('<sfile>:p'), 'puppet', 'ftplugin/epuppet.vim') finish endif diff --git a/ftplugin/framescript.vim b/ftplugin/framescript.vim index 9ec58b5f..ba858408 100644 --- a/ftplugin/framescript.vim +++ b/ftplugin/framescript.vim @@ -7,14 +7,14 @@ endif " Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Latest Revision: 2008-07-19 -let s:cpo_save = &cpo -set cpo&vim - 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< fo< inc< | unlet! b:matchwords" setlocal comments=s1:/*,mb:*,ex:*/,:// commentstring=/*\ %s\ */ diff --git a/ftplugin/freebasic.vim b/ftplugin/freebasic.vim new file mode 100644 index 00000000..d2212481 --- /dev/null +++ b/ftplugin/freebasic.vim @@ -0,0 +1,17 @@ +if polyglot#init#is_disabled(expand('<sfile>:p'), 'freebasic', 'ftplugin/freebasic.vim') + finish +endif + +" Vim filetype plugin file +" Language: FreeBasic +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2015 Jan 10 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +runtime! ftplugin/basic.vim + +" vim: ts=8 diff --git a/ftplugin/hamster.vim b/ftplugin/hamster.vim index c72a8657..2eca00f8 100644 --- a/ftplugin/hamster.vim +++ b/ftplugin/hamster.vim @@ -6,7 +6,7 @@ endif " Language: Hamster Script " Version: 2.0.6.0 " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> -" Last Change: 2017 Mar 18 +" Last Change: 2021 Jan 19 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -61,6 +61,9 @@ if exists("loaded_matchit") endif setlocal ignorecase + let &cpo = s:cpo_save unlet s:cpo_save -setlocal cpo+=M " makes \%( match \) + +" Disabled, 'cpo' is a global option. +" setlocal cpo+=M " makes \%( match \) diff --git a/ftplugin/lisp.vim b/ftplugin/lisp.vim index 365a26b8..cc86c720 100644 --- a/ftplugin/lisp.vim +++ b/ftplugin/lisp.vim @@ -18,13 +18,11 @@ endif " Don't load another plugin for this buffer let b:did_ftplugin = 1 -setl comments=:; +setl comments=:;;;;,:;;;,:;;,:;,sr:#\|,mb:\|,ex:\|# setl define=^\\s*(def\\k* setl formatoptions-=t setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 setl lisp setl commentstring=;%s -setl comments^=:;;;,:;;,sr:#\|,mb:\|,ex:\|# - let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp< commentstring<" diff --git a/ftplugin/octave.vim b/ftplugin/octave.vim new file mode 100644 index 00000000..c9408150 --- /dev/null +++ b/ftplugin/octave.vim @@ -0,0 +1,5 @@ +if polyglot#init#is_disabled(expand('<sfile>:p'), 'octave', 'ftplugin/octave.vim') + finish +endif + +setlocal commentstring=%\ %s diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim index a131a1d1..c13edfbc 100644 --- a/ftplugin/rust.vim +++ b/ftplugin/rust.vim @@ -51,7 +51,7 @@ setlocal smartindent nocindent if get(g:, 'rust_recommended_style', 1) let b:rust_set_style = 1 - setlocal tabstop=8 shiftwidth=4 softtabstop=4 expandtab + setlocal shiftwidth=4 softtabstop=4 expandtab setlocal textwidth=99 endif diff --git a/ftplugin/sxhkdrc.vim b/ftplugin/sxhkdrc.vim index b58baa1f..8b5be981 100644 --- a/ftplugin/sxhkdrc.vim +++ b/ftplugin/sxhkdrc.vim @@ -2,4 +2,14 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'sxhkd', 'ftplugin/sxhkdrc.vim finish endif +if exists("b:did_ftplugin") + finish +endif + setlocal cms=#%s + +if exists('b:undo_ftplugin') + let b:undo_ftplugin .= "|setlocal commentstring<" +else + let b:undo_ftplugin = "setlocal commentstring<" +endif diff --git a/ftplugin/tidy.vim b/ftplugin/tidy.vim new file mode 100644 index 00000000..8f368fa9 --- /dev/null +++ b/ftplugin/tidy.vim @@ -0,0 +1,36 @@ +if polyglot#init#is_disabled(expand('<sfile>:p'), 'tidy', 'ftplugin/tidy.vim') + finish +endif + +" Vim filetype plugin file +" Language: HMTL Tidy Configuration +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2020 Sep 4 + +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 + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "HTML Tidy Files (tidyrc, .tidyrc, tidy.conf)\ttidyrc;.tidyrc;tidy.conf\n" . + \ "HTML Files (*.html, *.htm)\t*.html;*.htm\n" . + \ "XHTML Files (*.xhtml, *.xhtm)\t*.xhtml;*.xhtm\n" . + \ "XML Files (*.xml)\t*.xml\n" . + \ "All Files (*.*)\t*.*\n" +endif + +let b:undo_ftplugin = "setl fo< com< cms<" . + \ " | unlet! b:browsefilter" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 diff --git a/ftplugin/vlang.vim b/ftplugin/vlang.vim index cda16cba..fbc0a711 100644 --- a/ftplugin/vlang.vim +++ b/ftplugin/vlang.vim @@ -2,5 +2,36 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'v', 'ftplugin/vlang.vim') finish endif +if exists("b:did_ftplugin") + finish +endif + setlocal commentstring=//\ %s setlocal makeprg=v\ % + +if exists('b:undo_ftplugin') + let b:undo_ftplugin .= "|setlocal commentstring< makeprg<" +else + let b:undo_ftplugin = "setlocal commentstring< makeprg<" +endif + +function! _VFormatFile() + if exists('g:v_autofmt_bufwritepre') && g:v_autofmt_bufwritepre || exists('b:v_autofmt_bufwritepre') && b:v_autofmt_bufwritepre + let substitution = system("v fmt -", join(getline(1, line('$')), "\n")) + if v:shell_error != 0 + echoerr "While formatting the buffer via vfmt, the following error occurred:" + echoerr printf("ERROR(%d): %s", v:shell_error, substitution) + else + let [_, lnum, colnum, _] = getpos('.') + %delete + call append(0, split(substitution, "\n")) + call cursor(lnum, colnum) + endif + endif +endfunction + +if has('autocmd') + augroup v_fmt + autocmd BufWritePre *.v call _VFormatFile() + augroup END +endif diff --git a/ftplugin/zig.vim b/ftplugin/zig.vim index 3b88372c..cb2f3e84 100644 --- a/ftplugin/zig.vim +++ b/ftplugin/zig.vim @@ -12,6 +12,11 @@ let b:did_ftplugin = 1 let s:cpo_orig = &cpo set cpo&vim +compiler zig_build + +" Match Zig builtin fns +setlocal iskeyword+=@-@ + " Recomended code style, no tabs and 4-space indentation setlocal expandtab setlocal tabstop=8 @@ -21,7 +26,6 @@ setlocal shiftwidth=4 setlocal formatoptions-=t formatoptions+=croql setlocal suffixesadd=.zig,.zir -setlocal makeprg=zig\ build if has('comments') setlocal comments=:///,://!,://,:\\\\ @@ -44,7 +48,7 @@ if exists("*json_decode") && executable('zig') endif let b:undo_ftplugin = - \ 'setl et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<' + \ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<' let &cpo = s:cpo_orig unlet s:cpo_orig |