diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2022-08-03 00:08:17 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2022-08-03 00:08:17 -0600 |
commit | 9449e1b8d273ff78eb894c588110ffa0c17d6ee3 (patch) | |
tree | 9e4470c33bd4187d9f42f0b2c4aaa995310c5be8 /runtime/ftplugin | |
parent | 308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (diff) | |
parent | b8dcbcc732baf84fc48d6b272c3ade0bcb129b3b (diff) | |
download | rneovim-9449e1b8d273ff78eb894c588110ffa0c17d6ee3.tar.gz rneovim-9449e1b8d273ff78eb894c588110ffa0c17d6ee3.tar.bz2 rneovim-9449e1b8d273ff78eb894c588110ffa0c17d6ee3.zip |
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/bitbake.vim | 16 | ||||
-rw-r--r-- | runtime/ftplugin/debchangelog.vim | 101 | ||||
-rw-r--r-- | runtime/ftplugin/desktop.vim | 13 | ||||
-rw-r--r-- | runtime/ftplugin/expect.vim | 24 | ||||
-rw-r--r-- | runtime/ftplugin/html.vim | 60 | ||||
-rw-r--r-- | runtime/ftplugin/swayconfig.vim | 16 |
6 files changed, 156 insertions, 74 deletions
diff --git a/runtime/ftplugin/bitbake.vim b/runtime/ftplugin/bitbake.vim new file mode 100644 index 0000000000..99fe334627 --- /dev/null +++ b/runtime/ftplugin/bitbake.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: Bitbake +" Maintainer: Gregory Anders <greg@gpanders.com> +" Repository: https://github.com/openembedded/bitbake +" Latest Revision: 2022-07-23 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal commentstring=#%s +setlocal comments=:# +setlocal suffixesadd=.bb,.bbclass + +let b:undo_ftplugin = "setl cms< com< sua<" diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim index a78f7811f1..cf8dd17c44 100644 --- a/runtime/ftplugin/debchangelog.vim +++ b/runtime/ftplugin/debchangelog.vim @@ -1,9 +1,9 @@ " Vim filetype plugin file (GUI menu, folding and completion) " Language: Debian Changelog -" Maintainer: Debian Vim Maintainers +" Maintainer: Debian Vim Maintainers <team+vim@tracker.debian.org> " Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de> " Stefano Zacchiroli <zack@debian.org> -" Last Change: 2018-01-28 +" Last Change: 2022 Jul 25 " License: Vim License " URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debchangelog.vim @@ -35,6 +35,11 @@ if exists('g:did_changelog_ftplugin') finish endif +" Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise +" <CR> would not be recognized. See ":help 'cpoptions'". +let s:cpo_save = &cpo +set cpo&vim + " Don't load another plugin (this is global) let g:did_changelog_ftplugin = 1 @@ -101,13 +106,13 @@ endfunction " These functions implement the menus function NewVersion() " The new entry is unfinalised and shall be changed - amenu disable Changelog.New\ Version - amenu enable Changelog.Add\ Entry - amenu enable Changelog.Close\ Bug - amenu enable Changelog.Set\ Distribution - amenu enable Changelog.Set\ Urgency - amenu disable Changelog.Unfinalise - amenu enable Changelog.Finalise + amenu disable &Changelog.&New\ Version + amenu enable &Changelog.&Add\ Entry + amenu enable &Changelog.&Close\ Bug + amenu enable &Changelog.Set\ &Distribution + amenu enable &Changelog.Set\ &Urgency + amenu disable &Changelog.U&nfinalise + amenu enable &Changelog.&Finalise call append(0, substitute(getline(1), '-\([[:digit:]]\+\))', '-$$\1)', '')) call append(1, '') call append(2, '') @@ -117,7 +122,9 @@ function NewVersion() normal! 1G0 call search(')') normal! h - normal! + " ':normal' doens't support key annotation (<c-a>) directly. + " Vim's manual recommends using ':exe' to use key annotation indirectly (backslash-escaping needed though). + exe "normal! \<c-a>" call setline(1, substitute(getline(1), '-\$\$', '-', '')) if exists('g:debchangelog_fold_enable') foldopen @@ -161,13 +168,13 @@ endfunction function <SID>UnfinaliseMenu() " This means the entry shall be changed - amenu disable Changelog.New\ Version - amenu enable Changelog.Add\ Entry - amenu enable Changelog.Close\ Bug - amenu enable Changelog.Set\ Distribution - amenu enable Changelog.Set\ Urgency - amenu disable Changelog.Unfinalise - amenu enable Changelog.Finalise + amenu disable &Changelog.&New\ Version + amenu enable &Changelog.&Add\ Entry + amenu enable &Changelog.&Close\ Bug + amenu enable &Changelog.Set\ &Distribution + amenu enable &Changelog.Set\ &Urgency + amenu disable &Changelog.U&nfinalise + amenu enable &Changelog.&Finalise endfunction function Unfinalise() @@ -179,13 +186,13 @@ endfunction function <SID>FinaliseMenu() " This means the entry should not be changed anymore - amenu enable Changelog.New\ Version - amenu disable Changelog.Add\ Entry - amenu disable Changelog.Close\ Bug - amenu disable Changelog.Set\ Distribution - amenu disable Changelog.Set\ Urgency - amenu enable Changelog.Unfinalise - amenu disable Changelog.Finalise + amenu enable &Changelog.&New\ Version + amenu disable &Changelog.&Add\ Entry + amenu disable &Changelog.&Close\ Bug + amenu disable &Changelog.Set\ &Distribution + amenu disable &Changelog.Set\ &Urgency + amenu enable &Changelog.U&nfinalise + amenu disable &Changelog.&Finalise endfunction function Finalise() @@ -198,26 +205,26 @@ endfunction function <SID>MakeMenu() amenu &Changelog.&New\ Version :call NewVersion()<CR> - amenu Changelog.&Add\ Entry :call AddEntry()<CR> - amenu Changelog.&Close\ Bug :call CloseBug()<CR> - menu Changelog.-sep- <nul> - - amenu Changelog.Set\ &Distribution.&unstable :call Distribution("unstable")<CR> - amenu Changelog.Set\ Distribution.&frozen :call Distribution("frozen")<CR> - amenu Changelog.Set\ Distribution.&stable :call Distribution("stable")<CR> - menu Changelog.Set\ Distribution.-sep- <nul> - amenu Changelog.Set\ Distribution.frozen\ unstable :call Distribution("frozen unstable")<CR> - amenu Changelog.Set\ Distribution.stable\ unstable :call Distribution("stable unstable")<CR> - amenu Changelog.Set\ Distribution.stable\ frozen :call Distribution("stable frozen")<CR> - amenu Changelog.Set\ Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable")<CR> - - amenu Changelog.Set\ &Urgency.&low :call Urgency("low")<CR> - amenu Changelog.Set\ Urgency.&medium :call Urgency("medium")<CR> - amenu Changelog.Set\ Urgency.&high :call Urgency("high")<CR> - - menu Changelog.-sep- <nul> - amenu Changelog.U&nfinalise :call Unfinalise()<CR> - amenu Changelog.&Finalise :call Finalise()<CR> + amenu &Changelog.&Add\ Entry :call AddEntry()<CR> + amenu &Changelog.&Close\ Bug :call CloseBug()<CR> + menu &Changelog.-sep- <nul> + + amenu &Changelog.Set\ &Distribution.&unstable :call Distribution("unstable")<CR> + amenu &Changelog.Set\ &Distribution.&frozen :call Distribution("frozen")<CR> + amenu &Changelog.Set\ &Distribution.&stable :call Distribution("stable")<CR> + menu &Changelog.Set\ &Distribution.-sep- <nul> + amenu &Changelog.Set\ &Distribution.frozen\ unstable :call Distribution("frozen unstable")<CR> + amenu &Changelog.Set\ &Distribution.stable\ unstable :call Distribution("stable unstable")<CR> + amenu &Changelog.Set\ &Distribution.stable\ frozen :call Distribution("stable frozen")<CR> + amenu &Changelog.Set\ &Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable")<CR> + + amenu &Changelog.Set\ &Urgency.&low :call Urgency("low")<CR> + amenu &Changelog.Set\ &Urgency.&medium :call Urgency("medium")<CR> + amenu &Changelog.Set\ &Urgency.&high :call Urgency("high")<CR> + + menu &Changelog.-sep- <nul> + amenu &Changelog.U&nfinalise :call Unfinalise()<CR> + amenu &Changelog.&Finalise :call Finalise()<CR> if <SID>Finalised() call <SID>FinaliseMenu() @@ -228,7 +235,7 @@ endfunction augroup changelogMenu au BufEnter * if &filetype == "debchangelog" | call <SID>MakeMenu() | endif -au BufLeave * if &filetype == "debchangelog" | silent! aunmenu Changelog | endif +au BufLeave * if &filetype == "debchangelog" | silent! aunmenu &Changelog | endif augroup END " }}} @@ -380,4 +387,8 @@ setlocal omnifunc=DebCompleteBugs " }}} +" Restore the previous value of 'cpoptions'. +let &cpo = s:cpo_save +unlet s:cpo_save + " vim: set foldmethod=marker: diff --git a/runtime/ftplugin/desktop.vim b/runtime/ftplugin/desktop.vim new file mode 100644 index 0000000000..bd6fd7097c --- /dev/null +++ b/runtime/ftplugin/desktop.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin file +" Language: XDG desktop entry +" Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com ) +" Last Change: 2022-07-26 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = v:true + +setl comments=:# +setl commentstring=#%s +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/expect.vim b/runtime/ftplugin/expect.vim new file mode 100644 index 0000000000..a4c6af96ce --- /dev/null +++ b/runtime/ftplugin/expect.vim @@ -0,0 +1,24 @@ +" Vim filetype plugin file +" Language: Expect +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2022 Jul 16 + +if exists("b:did_ftplugin") + finish +endif + +" Syntax is similar to Tcl +runtime! ftplugin/tcl.vim + +let s:cpo_save = &cpo +set cpo&vim + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Expect Command Files (*.exp)\t*.exp\n" .. + \ "All Files (*.*)\t*.*\n" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 diff --git a/runtime/ftplugin/html.vim b/runtime/ftplugin/html.vim index 3179aa2e88..94cb62653f 100644 --- a/runtime/ftplugin/html.vim +++ b/runtime/ftplugin/html.vim @@ -1,16 +1,14 @@ " Vim filetype plugin file -" Language: html -" -" This runtime file is looking for a new maintainer. -" -" Former maintainer: Dan Sharp -" Last Changed: 20 Jan 2009 - -if exists("b:did_ftplugin") | finish | endif +" Language: HTML +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Dan Sharp +" Last Changed: 2022 Jul 20 + +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 @@ -18,36 +16,40 @@ setlocal matchpairs+=<:> setlocal commentstring=<!--%s--> setlocal comments=s:<!--,m:\ \ \ \ ,e:--> -if exists("g:ft_html_autocomment") && (g:ft_html_autocomment == 1) - setlocal formatoptions-=t formatoptions+=croql +let b:undo_ftplugin = "setlocal comments< commentstring< matchpairs<" + +if get(g:, "ft_html_autocomment", 0) + setlocal formatoptions-=t formatoptions+=croql + let b:undo_ftplugin ..= " | setlocal formatoptions<" endif if exists('&omnifunc') setlocal omnifunc=htmlcomplete#CompleteTags call htmlcomplete#DetectOmniFlavor() + let b:undo_ftplugin ..= " | setlocal omnifunc<" endif -" HTML: 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>' +" HTML: thanks to Johannes Zellner and Benji Fisher. +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_ignorecase = 1 + let b:match_words = '<!--:-->,' .. + \ '<:>,' .. + \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .. + \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .. + \ '<\@<=\([^/!][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>' + let b:html_set_match_words = 1 + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:html_set_match_words" endif " Change the :browse e filter to primarily show HTML-related files. -if has("gui_win32") - let b:browsefilter="HTML Files (*.html,*.htm)\t*.htm;*.html\n" . - \ "JavaScript Files (*.js)\t*.js\n" . - \ "Cascading StyleSheets (*.css)\t*.css\n" . - \ "All Files (*.*)\t*.*\n" +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "HTML Files (*.html *.htm)\t*.htm;*.html\n" .. + \ "JavaScript Files (*.js)\t*.js\n" .. + \ "Cascading StyleSheets (*.css)\t*.css\n" .. + \ "All Files (*.*)\t*.*\n" + let b:html_set_browsefilter = 1 + let b:undo_ftplugin ..= " | unlet! b:browsefilter b:html_set_browsefilter" endif -" Undo the stuff we changed. -let b:undo_ftplugin = "setlocal commentstring< matchpairs< omnifunc< comments< formatoptions<" . - \ " | unlet! b:match_ignorecase b:match_skip b:match_words b:browsefilter" - -" Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo diff --git a/runtime/ftplugin/swayconfig.vim b/runtime/ftplugin/swayconfig.vim new file mode 100644 index 0000000000..45d6bdb3e5 --- /dev/null +++ b/runtime/ftplugin/swayconfig.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: sway config file +" Original Author: James Eapen <james.eapen@vai.org> +" Maintainer: James Eapen <james.eapen@vai.org> +" Version: 0.1 +" Last Change: 2022 June 07 + +if exists("b:did_ftplugin") + finish +endif + +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setlocal cms<" + +setlocal commentstring=#\ %s |