diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 02:10:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 02:10:58 +0000 |
commit | bee19c22d569e54513a9c591441c7f411811dc81 (patch) | |
tree | b990d2df9fddb8194bfe49e9205005a0d952bc1f /runtime/ftplugin | |
parent | Adding upstream version 2:9.1.0199. (diff) | |
download | vim-bee19c22d569e54513a9c591441c7f411811dc81.tar.xz vim-bee19c22d569e54513a9c591441c7f411811dc81.zip |
Adding upstream version 2:9.1.0374.upstream/2%9.1.0374
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | runtime/ftplugin/asm.vim | 14 | ||||
-rw-r--r-- | runtime/ftplugin/astro.vim | 186 | ||||
-rw-r--r-- | runtime/ftplugin/bp.vim | 14 | ||||
-rw-r--r-- | runtime/ftplugin/cgdbrc.vim | 21 | ||||
-rw-r--r-- | runtime/ftplugin/cmake.vim | 5 | ||||
-rw-r--r-- | runtime/ftplugin/dts.vim | 16 | ||||
-rw-r--r-- | runtime/ftplugin/gdb.vim | 12 | ||||
-rw-r--r-- | runtime/ftplugin/java.vim | 60 | ||||
-rw-r--r-- | runtime/ftplugin/kconfig.vim | 17 | ||||
-rw-r--r-- | runtime/ftplugin/ondir.vim | 18 | ||||
-rw-r--r-- | runtime/ftplugin/requirements.vim | 43 | ||||
-rw-r--r-- | runtime/ftplugin/roc.vim | 14 | ||||
-rw-r--r-- | runtime/ftplugin/uci.vim | 21 | ||||
-rw-r--r-- | runtime/ftplugin/vim.vim | 8 | ||||
-rw-r--r-- | runtime/ftplugin/yaml.vim | 7 | ||||
-rw-r--r-- | runtime/ftplugin/zathurarc.vim | 22 |
16 files changed, 451 insertions, 27 deletions
diff --git a/runtime/ftplugin/asm.vim b/runtime/ftplugin/asm.vim index f6a92d5..0ae1610 100644 --- a/runtime/ftplugin/asm.vim +++ b/runtime/ftplugin/asm.vim @@ -1,13 +1,23 @@ " Vim filetype plugin file " Language: asm " Maintainer: Colin Caine <cmcaine at the common googlemail domain> -" Last Change: 23 May 2020 +" Last Change: 2020 May 23 " 2023 Aug 28 by Vim Project (undo_ftplugin) +" 2024 Apr 09 by Vim Project (add Matchit support) 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 -let b:undo_ftplugin = "setl commentstring< comments<" +let b:undo_ftplugin = "setl commentstring< comments< include<" + +" Matchit support +if !exists('b:match_words') + let b:match_skip = 's:comment\|string\|character\|special' + let b:match_words = '^\s*%\s*if\%(\|num\|idn\|nidn\)\>:^\s*%\s*elif\>:^\s*%\s*else\>:^\s*%\s*endif\>,^\s*%\s*macro\>:^\s*%\s*endmacro\>,^\s*%\s*rep\>:^\s*%\s*endrep\>' + let b:match_ignorecase = 1 + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:match_skip" +endif diff --git a/runtime/ftplugin/astro.vim b/runtime/ftplugin/astro.vim new file mode 100644 index 0000000..0b0e034 --- /dev/null +++ b/runtime/ftplugin/astro.vim @@ -0,0 +1,186 @@ +" Vim filetype plugin file +" Language: Astro +" Maintainer: Romain Lafourcade <romainlafourcade@gmail.com> +" Last Change: 2024 Apr 21 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo-=C + +function! s:IdentifyScope(start, end) abort + let pos_start = searchpairpos(a:start, '', a:end, 'bnW') + let pos_end = searchpairpos(a:start, '', a:end, 'nW') + + return pos_start != [0, 0] + \ && pos_end != [0, 0] + \ && pos_start[0] != getpos('.')[1] +endfunction + +function! s:AstroComments() abort + if s:IdentifyScope('^---\n\s*\S', '^---\n\n') + \ || s:IdentifyScope('^\s*<script', '^\s*<\/script>') + " ECMAScript comments + setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// + setlocal commentstring=//%s + + elseif s:IdentifyScope('^\s*<style', '^\s*<\/style>') + " CSS comments + setlocal comments=s1:/*,mb:*,ex:*/ + setlocal commentstring=/*%s*/ + + else + " HTML comments + setlocal comments=s:<!--,m:\ \ \ \ ,e:--> + setlocal commentstring=<!--%s--> + endif +endfunction + +" https://code.visualstudio.com/docs/languages/jsconfig +function! s:CollectPathsFromConfig() abort + let config_json = findfile('tsconfig.json', '.;') + + if empty(config_json) + let config_json = findfile('jsconfig.json', '.;') + + if empty(config_json) + return + endif + endif + + let paths_from_config = config_json + \ ->readfile() + \ ->filter({ _, val -> val =~ '^\s*[\[\]{}"0-9]' }) + \ ->join() + \ ->json_decode() + \ ->get('compilerOptions', {}) + \ ->get('paths', {}) + + if !empty(paths_from_config) + let b:astro_paths = paths_from_config + \ ->map({key, val -> [ + \ key->glob2regpat(), + \ val[0]->substitute('\/\*$', '', '') + \ ]}) + \ ->values() + endif + + let b:undo_ftplugin ..= " | unlet! b:astro_paths" +endfunction + +function! s:AstroInclude(filename) abort + let decorated_filename = a:filename + \ ->substitute("^", "@", "") + + let found_path = b: + \ ->get("astro_paths", []) + \ ->indexof({ key, val -> decorated_filename =~ val[0]}) + + if found_path != -1 + let alias = b:astro_paths[found_path][0] + let path = b:astro_paths[found_path][1] + \ ->substitute('\(\/\)*$', '/', '') + + return decorated_filename + \ ->substitute(alias, path, '') + endif + + return a:filename +endfunction + +let b:undo_ftplugin = "setlocal" + \ .. " formatoptions<" + \ .. " path<" + \ .. " suffixesadd<" + \ .. " matchpairs<" + \ .. " comments<" + \ .. " commentstring<" + \ .. " iskeyword<" + \ .. " define<" + \ .. " include<" + \ .. " includeexpr<" + +" Create self-resetting autocommand group +augroup Astro + autocmd! * <buffer> +augroup END + +" Set 'formatoptions' to break comment lines but not other lines, +" and insert the comment leader when hitting <CR> or using "o". +setlocal formatoptions-=t +setlocal formatoptions+=croql + +" Remove irrelevant part of 'path'. +setlocal path-=/usr/include + +" Seed 'path' with default directories for :find, gf, etc. +setlocal path+=src/** +setlocal path+=public/** + +" Help Vim find extension-less filenames +let &l:suffixesadd = + \ ".astro" + \ .. ",.js,.jsx,.es,.es6,.cjs,.mjs,.jsm" + \ .. ",.json" + \ .. ",.scss,.sass,.css" + \ .. ",.svelte" + \ .. ",.ts,.tsx,.d.ts" + \ .. ",.vue" + +" From $VIMRUNTIME/ftplugin/html.vim +setlocal matchpairs+=<:> + +" Matchit configuration +if exists("loaded_matchit") + let b:match_ignorecase = 0 + + " From $VIMRUNTIME/ftplugin/javascript.vim + let b:match_words = + \ '\<do\>:\<while\>,' + \ .. '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,' + \ .. '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>' + + " From $VIMRUNTIME/ftplugin/html.vim + let b:match_words ..= + \ '<!--:-->,' + \ .. '<:>,' + \ .. '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' + \ .. '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' + \ .. '<\@<=\([^/!][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' + + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" +endif + +" Change what constitutes a word, mainly useful for CSS/SASS +setlocal iskeyword+=- +setlocal iskeyword+=$ +setlocal iskeyword+=% + +" Define paths/aliases for module resolution +call s:CollectPathsFromConfig() + +" Find ESM imports +setlocal include=^\\s*\\(import\\\|import\\s\\+[^\/]\\+from\\)\\s\\+['\"] + +" Process aliases if file can't be found +setlocal includeexpr=s:AstroInclude(v:fname) + +" Set 'define' to a comprehensive value +" From $VIMRUNTIME/ftplugin/javascript.vim and +" $VIMRUNTIME/ftplugin/sass.vim +let &l:define = + \ '\(^\s*(*async\s\+function\|(*function\)' + \ .. '\|^\s*\(\*\|static\|async\|get\|set\|\i\+\.\)' + \ .. '\|^\s*\(\ze\i\+\)\(([^)]*).*{$\|\s*[:=,]\)' + + +" Set &comments and &commentstring according to current scope +autocmd Astro CursorMoved <buffer> call s:AstroComments() + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: textwidth=78 tabstop=8 shiftwidth=4 softtabstop=4 expandtab diff --git a/runtime/ftplugin/bp.vim b/runtime/ftplugin/bp.vim new file mode 100644 index 0000000..5ddebe5 --- /dev/null +++ b/runtime/ftplugin/bp.vim @@ -0,0 +1,14 @@ +" Blueprint build system filetype plugin file +" Language: Blueprint +" Maintainer: Bruno BELANYI <bruno.vim@belanyi.fr> +" Latest Revision: 2024-04-19 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=b://,s1:/*,mb:*,ex:*/ +setlocal commentstring=//\ %s + +let b:undo_ftplugin = "setlocal comments< commentstring<" diff --git a/runtime/ftplugin/cgdbrc.vim b/runtime/ftplugin/cgdbrc.vim new file mode 100644 index 0000000..46cf135 --- /dev/null +++ b/runtime/ftplugin/cgdbrc.vim @@ -0,0 +1,21 @@ +" Vim filetype plugin file +" Language: cgdbrc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Documentation: https://cgdb.github.io/docs/Configuring-CGDB.html +" Latest Revision: 2024-04-09 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +let b:undo_ftplugin = 'setl com< cms<' + +setlocal commentstring=#%s +setlocal comments=:# + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions diff --git a/runtime/ftplugin/cmake.vim b/runtime/ftplugin/cmake.vim index 94c0076..9fcf87a 100644 --- a/runtime/ftplugin/cmake.vim +++ b/runtime/ftplugin/cmake.vim @@ -2,6 +2,7 @@ " Language: CMake " Maintainer: Keith Smiley <keithbsmiley@gmail.com> " Last Change: 2018 Aug 30 +" 2024 Apr 20 - add include and suffixadd (Vim Project) " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -15,7 +16,7 @@ set cpo&vim " Don't load another plugin for this buffer let b:did_ftplugin = 1 -let b:undo_ftplugin = "setl commentstring<" +let b:undo_ftplugin = "setl inc< sua< commentstring<" if exists('loaded_matchit') let b:match_words = '\<if\>:\<elseif\>\|\<else\>:\<endif\>' @@ -27,6 +28,8 @@ if exists('loaded_matchit') let b:undo_ftplugin .= "| unlet b:match_words" endif +setlocal include=\s*include +setlocal suffixesadd=.cmake,-config.cmake setlocal commentstring=#\ %s " restore 'cpo' and clean up buffer variable diff --git a/runtime/ftplugin/dts.vim b/runtime/ftplugin/dts.vim new file mode 100644 index 0000000..42e3833 --- /dev/null +++ b/runtime/ftplugin/dts.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: dts/dtsi (device tree files) +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Latest Revision: 2024 Apr 12 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let b:undo_ftplugin = 'setl inc< cms< com<' + +setlocal include=^\\%(#include\\\|/include/\\) +" same as C +setlocal commentstring& +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// diff --git a/runtime/ftplugin/gdb.vim b/runtime/ftplugin/gdb.vim index 2473b13..7c10633 100644 --- a/runtime/ftplugin/gdb.vim +++ b/runtime/ftplugin/gdb.vim @@ -1,12 +1,20 @@ " Vim filetype plugin file " Language: gdb " Maintainer: Michaƫl Peeters <NOSPAMm.vim@noekeon.org> -" Last Changed: 26 Oct 2017 +" Last Changed: 2017-10-26 +" 2024-04-10: - add Matchit support (by Vim Project) if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 setlocal commentstring=#%s +setlocal include=^\\s*source " Undo the stuff we changed. -let b:undo_ftplugin = "setlocal cms<" +let b:undo_ftplugin = "setlocal cms< include<" + +" Matchit support +if !exists('b:match_words') + let b:match_words = '\<\%(if\|while\|define\|document\)\>:\<else\>:\<end\>' + let b:undo_ftplugin ..= " | unlet! b:match_words" +endif diff --git a/runtime/ftplugin/java.vim b/runtime/ftplugin/java.vim index bb7e7cd..fa2b610 100644 --- a/runtime/ftplugin/java.vim +++ b/runtime/ftplugin/java.vim @@ -1,10 +1,9 @@ " Vim filetype plugin file " Language: Java -" -" This runtime file is looking for a new maintainer. -" -" Former maintainer: Dan Sharp -" Last Change: 2012 Mar 11 +" 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 " 2024 Jan 14 by Vim Project (browsefilter) if exists("b:did_ftplugin") | finish | endif @@ -23,8 +22,36 @@ set suffixes+=.class " name to / and append .java to the name, then search the path. setlocal includeexpr=substitute(v:fname,'\\.','/','g') setlocal suffixesadd=.java -if exists("g:ftplugin_java_source_path") - let &l:path=g:ftplugin_java_source_path . ',' . &l:path + +" Clean up in case this file is sourced again. +unlet! s:zip_func_upgradable + +" Documented in ":help ft-java-plugin". +if exists("g:ftplugin_java_source_path") && + \ type(g:ftplugin_java_source_path) == type("") + if filereadable(g:ftplugin_java_source_path) + if exists("#zip") && + \ g:ftplugin_java_source_path =~# '.\.\%(jar\|zip\)$' + if !exists("s:zip_files") + let s:zip_files = {} + endif + + let s:zip_files[bufnr('%')] = g:ftplugin_java_source_path + let s:zip_files[0] = g:ftplugin_java_source_path + let s:zip_func_upgradable = 1 + + function! JavaFileTypeZipFile() abort + let @/ = substitute(v:fname, '\.', '\\/', 'g') . '.java' + return get(s:zip_files, bufnr('%'), s:zip_files[0]) + endfunction + + " E120 for "inex=s:JavaFileTypeZipFile()" before v8.2.3900. + setlocal includeexpr=JavaFileTypeZipFile() + setlocal suffixesadd< + endif + else + let &l:path = g:ftplugin_java_source_path . ',' . &l:path + endif endif " Set 'formatoptions' to break comment lines but not other lines, @@ -53,6 +80,25 @@ let b:undo_ftplugin = "setlocal suffixes< suffixesadd<" . \ " formatoptions< comments< commentstring< path< includeexpr<" . \ " | unlet! b:browsefilter" +" See ":help vim9-mix". +if !has("vim9script") + let &cpo = s:save_cpo + unlet s:save_cpo + finish +endif + +if exists("s:zip_func_upgradable") + delfunction! JavaFileTypeZipFile + + def! s:JavaFileTypeZipFile(): string + @/ = substitute(v:fname, '\.', '\\/', 'g') .. '.java' + return get(zip_files, bufnr('%'), zip_files[0]) + enddef + + setlocal includeexpr=s:JavaFileTypeZipFile() + setlocal suffixesadd< +endif + " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo diff --git a/runtime/ftplugin/kconfig.vim b/runtime/ftplugin/kconfig.vim index 940ba74..7674907 100644 --- a/runtime/ftplugin/kconfig.vim +++ b/runtime/ftplugin/kconfig.vim @@ -1,9 +1,9 @@ " Vim filetype plugin file " Vim syntax file -" Maintainer: Christian Brabandt <cb@256bit.org> -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2015-05-29 -" License: Vim (see :h license) +" Maintainer: Christian Brabandt <cb@256bit.org> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2024-04-12 +" License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-kconfig if exists("b:did_ftplugin") @@ -11,17 +11,12 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin = 1 -let s:cpo_save = &cpo -set cpo&vim - -let b:undo_ftplugin = "setl com< cms< fo<" +let b:undo_ftplugin = "setl inc< com< cms< fo<" +setlocal include=source\\s\\+ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql " For matchit.vim if exists("loaded_matchit") let b:match_words = '^\<menu\>:\<endmenu\>,^\<if\>:\<endif\>,^\<choice\>:\<endchoice\>' endif - -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/runtime/ftplugin/ondir.vim b/runtime/ftplugin/ondir.vim new file mode 100644 index 0000000..0854578 --- /dev/null +++ b/runtime/ftplugin/ondir.vim @@ -0,0 +1,18 @@ +" Vim filetype plugin file +" Language: ondir <https://github.com/alecthomas/ondir> +" Maintainer: Jon Parise <jon@indelible.org> + +if exists('b:did_ftplugin') + finish +endif + +let s:cpo_save = &cpoptions + +setlocal comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl comments< commentstring<' + +let &cpoptions = s:cpo_save +unlet s:cpo_save + +" vim: et ts=4 sw=2 sts=2: diff --git a/runtime/ftplugin/requirements.vim b/runtime/ftplugin/requirements.vim new file mode 100644 index 0000000..fcfc1ac --- /dev/null +++ b/runtime/ftplugin/requirements.vim @@ -0,0 +1,43 @@ +" the Requirements File Format syntax support for Vim +" Version: 1.8.0 +" Author: raimon <raimon49@hotmail.com> +" Upstream: https://github.com/raimon49/requirements.txt.vim +" License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +let b:undo_ftplugin = "setl iskeyword< commentstring<" +" pip options contain "-" +setlocal iskeyword+=- +setlocal commentstring=#\ %s +compiler pip_compile + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions +" vim: et sw=4 ts=4 sts=4: diff --git a/runtime/ftplugin/roc.vim b/runtime/ftplugin/roc.vim new file mode 100644 index 0000000..c665108 --- /dev/null +++ b/runtime/ftplugin/roc.vim @@ -0,0 +1,14 @@ +" Roc filetype plugin file +" Language: Roc +" Maintainer: nat-418 <93013864+nat-418@users.noreply.github.com> +" Latest Revision: 2024-04-5 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:##,:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setl com< cms<" diff --git a/runtime/ftplugin/uci.vim b/runtime/ftplugin/uci.vim new file mode 100644 index 0000000..984dab6 --- /dev/null +++ b/runtime/ftplugin/uci.vim @@ -0,0 +1,21 @@ +" Vim ftplugin file +" Language: OpenWrt Unified Configuration Interface +" Maintainer: Colin Caine <complaints@cmcaine.co.uk> +" Upstream: https://github.com/cmcaine/vim-uci +" Last Change: 2024 Apr 17 +" +" For more information on uci, see https://openwrt.org/docs/guide-user/base-system/uci + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +" UCI files are indented with tabs. +setl noexpandtab +setl shiftwidth=0 +setl softtabstop=0 + +setl commentstring=#\ %s + +let b:undo_ftplugin = "setlocal et< cms< sts< sw<" diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 575af74..67f360b 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin -" Language: Vim -" Maintainer: The Vim Project <https://github.com/vim/vim> -" Last Change: 2023 Aug 10 +" Language: Vim +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2024 Apr 13 " Former Maintainer: Bram Moolenaar <Bram@vim.org> " Only do this when not done yet for this buffer @@ -50,7 +50,7 @@ setlocal isk+=# setlocal keywordprg=:help " Comments starts with # in Vim9 script. We have to guess which one to use. -if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>' +if "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>' setlocal commentstring=#%s else setlocal commentstring=\"%s diff --git a/runtime/ftplugin/yaml.vim b/runtime/ftplugin/yaml.vim index db7cbd7..8bfc45e 100644 --- a/runtime/ftplugin/yaml.vim +++ b/runtime/ftplugin/yaml.vim @@ -16,6 +16,13 @@ let b:undo_ftplugin = "setl com< cms< et< fo<" setlocal comments=:# commentstring=#\ %s expandtab setlocal formatoptions-=t formatoptions+=croql +" rime input method engine uses `*.custom.yaml` as its config files +if expand('%:r:e') ==# 'custom' + compiler rime_deployer + setlocal include=__include:\\s* + let b:undo_ftplugin ..= " inc<" +endif + if !exists("g:yaml_recommended_style") || g:yaml_recommended_style != 0 let b:undo_ftplugin ..= " sw< sts<" setlocal shiftwidth=2 softtabstop=2 diff --git a/runtime/ftplugin/zathurarc.vim b/runtime/ftplugin/zathurarc.vim new file mode 100644 index 0000000..259fb13 --- /dev/null +++ b/runtime/ftplugin/zathurarc.vim @@ -0,0 +1,22 @@ +" Vim filetype plugin file +" Language: Zathurarc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Documentation: https://pwmt.org/projects/zathura/documentation/ +" Upstream: https://github.com/Freed-Wu/zathurarc.vim +" Latest Revision: 2024-04-02 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +let b:undo_ftplugin = 'setlocal comments< commentstring< include<' +setlocal comments=:# +setlocal commentstring=#\ %s +setlocal include=^\sinclude + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions |