diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
commit | 9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch) | |
tree | 607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /runtime/ftplugin | |
parent | 9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff) | |
parent | 3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff) | |
download | rneovim-usermarks.tar.gz rneovim-usermarks.tar.bz2 rneovim-usermarks.zip |
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'runtime/ftplugin')
32 files changed, 674 insertions, 85 deletions
diff --git a/runtime/ftplugin/abaqus.vim b/runtime/ftplugin/abaqus.vim index 3faeff621a..5931cd921d 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 <costerwi@gmail.com> -" Last Change: 2022 Aug 03 +" Last Change: 2022 Oct 08 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") | finish | endif @@ -66,25 +66,44 @@ if exists("loaded_matchit") && !exists("b:match_words") endif if !exists("no_plugin_maps") && !exists("no_abaqus_maps") - " Define keys used to move [count] keywords backward or forward. - noremap <silent><buffer> [[ ?^\*\a<CR>:nohlsearch<CR> - noremap <silent><buffer> ]] /^\*\a<CR>:nohlsearch<CR> + " Map [[ and ]] keys to move [count] keywords backward or forward + nnoremap <silent><buffer> ]] :call <SID>Abaqus_NextKeyword(1)<CR> + nnoremap <silent><buffer> [[ :call <SID>Abaqus_NextKeyword(-1)<CR> + function! <SID>Abaqus_NextKeyword(direction) + .mark ' + if a:direction < 0 + let flags = 'b' + else + let flags = '' + endif + let l:count = abs(a:direction) * v:count1 + while l:count > 0 && search("^\\*\\a", flags) + let l:count -= 1 + endwhile + endfunction - " Define key to toggle commenting of the current line or range + " Map \\ to toggle commenting of the current line or range noremap <silent><buffer> <LocalLeader><LocalLeader> \ :call <SID>Abaqus_ToggleComment()<CR>j function! <SID>Abaqus_ToggleComment() range - if strpart(getline(a:firstline), 0, 2) == "**" - " Un-comment all lines in range - silent execute a:firstline . ',' . a:lastline . 's/^\*\*//' - else - " Comment all lines in range - silent execute a:firstline . ',' . a:lastline . 's/^/**/' - endif + if strpart(getline(a:firstline), 0, 2) == "**" + " Un-comment all lines in range + silent execute a:firstline . ',' . a:lastline . 's/^\*\*//' + else + " Comment all lines in range + silent execute a:firstline . ',' . a:lastline . 's/^/**/' + endif + endfunction + + " Map \s to swap first two comma separated fields + noremap <silent><buffer> <LocalLeader>s :call <SID>Abaqus_Swap()<CR> + function! <SID>Abaqus_Swap() range + silent execute a:firstline . ',' . a:lastline . 's/\([^*,]*\),\([^,]*\)/\2,\1/' endfunction let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]" \ . "|unmap <buffer> <LocalLeader><LocalLeader>" + \ . "|unmap <buffer> <LocalLeader>s" endif " Undo must be done in nocompatible mode for <LocalLeader>. diff --git a/runtime/ftplugin/apache.vim b/runtime/ftplugin/apache.vim new file mode 100644 index 0000000000..9f612f5447 --- /dev/null +++ b/runtime/ftplugin/apache.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin +" Language: apache configuration file +" Maintainer: Per Juchtmans <dubgeiser+vimNOSPAM@gmail.com> +" Last Change: 2022 Oct 22 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setlocal comments< commentstring<" + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/runtime/ftplugin/chatito.vim b/runtime/ftplugin/chatito.vim new file mode 100644 index 0000000000..af212e9581 --- /dev/null +++ b/runtime/ftplugin/chatito.vim @@ -0,0 +1,15 @@ +" Vim filetype plugin +" Language: Chatito +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Last Change: 2022 Sep 19 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:#,:// commentstring=#\ %s +" indent of 4 spaces is mandated by the spec +setlocal expandtab softtabstop=4 shiftwidth=4 + +let b:undo_ftplugin = 'setl com< cms< et< sts< sw<' diff --git a/runtime/ftplugin/checkhealth.vim b/runtime/ftplugin/checkhealth.vim index 3d8e9ace1a..62a1970b4a 100644 --- a/runtime/ftplugin/checkhealth.vim +++ b/runtime/ftplugin/checkhealth.vim @@ -1,20 +1,18 @@ " Vim filetype plugin -" Language: Neovim checkhealth buffer -" Last Change: 2021 Dec 15 +" Language: Nvim :checkhealth buffer +" Last Change: 2022 Nov 10 if exists("b:did_ftplugin") finish endif -runtime! ftplugin/markdown.vim ftplugin/markdown_*.vim ftplugin/markdown/*.vim +runtime! ftplugin/help.vim setlocal wrap breakindent linebreak -setlocal conceallevel=2 concealcursor=nc -setlocal keywordprg=:help let &l:iskeyword='!-~,^*,^|,^",192-255' if exists("b:undo_ftplugin") - let b:undo_ftplugin .= "|setl wrap< bri< lbr< cole< cocu< kp< isk<" + let b:undo_ftplugin .= "|setl wrap< bri< lbr< kp< isk<" else - let b:undo_ftplugin = "setl wrap< bri< lbr< cole< cocu< kp< isk<" + let b:undo_ftplugin = "setl wrap< bri< lbr< kp< isk<" endif diff --git a/runtime/ftplugin/crontab.vim b/runtime/ftplugin/crontab.vim new file mode 100644 index 0000000000..8dac007ccc --- /dev/null +++ b/runtime/ftplugin/crontab.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin +" Language: crontab +" Maintainer: Keith Smiley <keithbsmiley@gmail.com> +" Last Change: 2022 Sep 11 + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif + +" Don't load another plugin for this buffer +let b:did_ftplugin = 1 + +let b:undo_ftplugin = "setl commentstring<" + +setlocal commentstring=#\ %s diff --git a/runtime/ftplugin/cs.vim b/runtime/ftplugin/cs.vim index f53ffcbc8e..0734d11d22 100644 --- a/runtime/ftplugin/cs.vim +++ b/runtime/ftplugin/cs.vim @@ -2,7 +2,7 @@ " Language: C# " Maintainer: Nick Jensen <nickspoon@gmail.com> " Former Maintainer: Johannes Zellner <johannes@zellner.org> -" Last Change: 2021-12-07 +" Last Change: 2022-11-16 " License: Vim (see :h license) " Repository: https://github.com/nickspoons/vim-cs @@ -25,8 +25,9 @@ let b:undo_ftplugin = 'setl com< fo<' if exists('loaded_matchit') && !exists('b:match_words') " #if/#endif support included by default + let b:match_ignorecase = 0 let b:match_words = '\%(^\s*\)\@<=#\s*region\>:\%(^\s*\)\@<=#\s*endregion\>,' - let b:undo_ftplugin .= ' | unlet! b:match_words' + let b:undo_ftplugin .= ' | unlet! b:match_ignorecase b:match_words' endif if (has('gui_win32') || has('gui_gtk')) && !exists('b:browsefilter') diff --git a/runtime/ftplugin/elixir.vim b/runtime/ftplugin/elixir.vim index c423c2acb7..50f63673dc 100644 --- a/runtime/ftplugin/elixir.vim +++ b/runtime/ftplugin/elixir.vim @@ -1,7 +1,7 @@ " Elixir filetype plugin " Language: Elixir " Maintainer: Mitchell Hanberg <vimNOSPAM@mitchellhanberg.com> -" Last Change: 2022 August 10 +" Last Change: 2022 Sep 20 if exists("b:did_ftplugin") finish @@ -23,7 +23,11 @@ if exists('loaded_matchit') && !exists('b:match_words') \ ',{:},\[:\],(:)' endif +setlocal shiftwidth=2 softtabstop=2 expandtab iskeyword+=!,? +setlocal comments=:# setlocal commentstring=#\ %s +let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms<' + let &cpo = s:save_cpo unlet s:save_cpo diff --git a/runtime/ftplugin/erlang.vim b/runtime/ftplugin/erlang.vim index c775247f51..31fa0c3213 100644 --- a/runtime/ftplugin/erlang.vim +++ b/runtime/ftplugin/erlang.vim @@ -5,7 +5,7 @@ " Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com> " Eduardo Lopez (http://github.com/tapichu) " Arvid Bjurklint (http://github.com/slarwise) -" Last Update: 2021-Jan-08 +" Last Update: 2021-Nov-22 " License: Vim license " URL: https://github.com/vim-erlang/vim-erlang-runtime @@ -30,6 +30,28 @@ setlocal commentstring=%%s setlocal formatoptions+=ro +if get(g:, 'erlang_extend_path', 1) + " typical erlang.mk paths + let &l:path = join([ + \ 'deps/*/include', + \ 'deps/*/src', + \ 'deps/*/test', + \ 'deps/*/apps/*/include', + \ 'deps/*/apps/*/src', + \ &g:path], ',') + " typical rebar3 paths + let &l:path = join([ + \ 'apps/*/include', + \ 'apps/*/src', + \ '_build/default/lib/*/src', + \ '_build/default/*/include', + \ &l:path], ',') + " typical erlang paths + let &l:path = join(['include', 'src', 'test', &l:path], ',') + + set wildignore+=*/.erlang.mk/*,*.beam +endif + setlocal suffixesadd=.erl,.hrl let &l:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")' diff --git a/runtime/ftplugin/gitattributes.vim b/runtime/ftplugin/gitattributes.vim new file mode 100644 index 0000000000..2025d009d2 --- /dev/null +++ b/runtime/ftplugin/gitattributes.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: git attributes +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Last Change: 2022 Sep 08 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/gitignore.vim b/runtime/ftplugin/gitignore.vim new file mode 100644 index 0000000000..3502dd2717 --- /dev/null +++ b/runtime/ftplugin/gitignore.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: git ignore +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Last Change: 2022 Sep 10 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/gyp.vim b/runtime/ftplugin/gyp.vim new file mode 100644 index 0000000000..becfcadb6d --- /dev/null +++ b/runtime/ftplugin/gyp.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: GYP +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Last Change: 2022 Sep 27 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal formatoptions-=t +setlocal commentstring=#\ %s comments=b:#,fb:- + +let b:undo_ftplugin = 'setlocal fo< cms< com<' diff --git a/runtime/ftplugin/hare.vim b/runtime/ftplugin/hare.vim new file mode 100644 index 0000000000..bb10daf38c --- /dev/null +++ b/runtime/ftplugin/hare.vim @@ -0,0 +1,27 @@ +" Vim filetype plugin +" Language: Hare +" Maintainer: Amelia Clarke <me@rsaihe.dev> +" Previous Maintainer: Drew DeVault <sir@cmpwn.com> +" Last Updated: 2022-09-21 + +" Only do this when not done yet for this buffer +if exists('b:did_ftplugin') + finish +endif + +" Don't load another plugin for this buffer +let b:did_ftplugin = 1 + +setlocal noexpandtab +setlocal tabstop=8 +setlocal shiftwidth=0 +setlocal softtabstop=0 +setlocal textwidth=80 +setlocal commentstring=//\ %s + +" 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 + +compiler hare +" vim: tabstop=2 shiftwidth=2 expandtab diff --git a/runtime/ftplugin/heex.vim b/runtime/ftplugin/heex.vim new file mode 100644 index 0000000000..5274d59fbf --- /dev/null +++ b/runtime/ftplugin/heex.vim @@ -0,0 +1,16 @@ +" Elixir filetype plugin +" Language: HEEx +" Maintainer: Mitchell Hanberg <vimNOSPAM@mitchellhanberg.com> +" Last Change: 2022 Sep 21 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal shiftwidth=2 softtabstop=2 expandtab + +setlocal comments=:<%!-- +setlocal commentstring=<%!--\ %s\ --%> + +let b:undo_ftplugin = 'set sw< sts< et< com< cms<' diff --git a/runtime/ftplugin/jsonnet.vim b/runtime/ftplugin/jsonnet.vim new file mode 100644 index 0000000000..1e621e1867 --- /dev/null +++ b/runtime/ftplugin/jsonnet.vim @@ -0,0 +1,17 @@ +" Vim filetype plugin +" Language: Jsonnet +" Maintainer: Cezary Drożak <cezary@drozak.net> +" URL: https://github.com/google/vim-jsonnet +" Last Change: 2022-09-08 + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif + +" Don't load another plugin for this buffer +let b:did_ftplugin = 1 + +setlocal commentstring=//\ %s + +let b:undo_ftplugin = "setlocal commentstring<" diff --git a/runtime/ftplugin/lua.lua b/runtime/ftplugin/lua.lua new file mode 100644 index 0000000000..415cf28f9a --- /dev/null +++ b/runtime/ftplugin/lua.lua @@ -0,0 +1,3 @@ +if vim.g.ts_highlight_lua then + vim.treesitter.start() +end diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim index 2604257594..88b1fc9d44 100644 --- a/runtime/ftplugin/lua.vim +++ b/runtime/ftplugin/lua.vim @@ -1,46 +1,49 @@ " Vim filetype plugin file. -" Language: Lua +" Language: Lua " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainer: Max Ischenko <mfi@ukr.net> -" Last Change: 2021 Nov 15 +" Contributor: Dorai Sitaram <ds26@gte.com> +" C.D. MacEachern <craig.daniel.maceachern@gmail.com> +" Last Change: 2022 Nov 19 -" Only do this when not done yet for this buffer if exists("b:did_ftplugin") finish endif - -" Don't load another plugin for this buffer let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -" Set 'formatoptions' to break comment lines but not other lines, and insert -" the comment leader when hitting <CR> or using "o". +setlocal comments=:-- +setlocal commentstring=--\ %s setlocal formatoptions-=t formatoptions+=croql -setlocal comments=:-- -setlocal commentstring=--%s +let &l:define = '\<function\|\<local\%(\s\+function\)\=' + +" TODO: handle init.lua +setlocal includeexpr=tr(v:fname,'.','/') setlocal suffixesadd=.lua -let b:undo_ftplugin = "setlocal fo< com< cms< sua<" +let b:undo_ftplugin = "setlocal cms< com< def< fo< inex< sua<" if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 let b:match_words = - \ '\<\%(do\|function\|if\)\>:' . - \ '\<\%(return\|else\|elseif\)\>:' . - \ '\<end\>,' . - \ '\<repeat\>:\<until\>,' . - \ '\%(--\)\=\[\(=*\)\[:]\1]' - let b:undo_ftplugin .= " | unlet! b:match_words b:match_ignorecase" + \ '\<\%(do\|function\|if\)\>:' .. + \ '\<\%(return\|else\|elseif\)\>:' .. + \ '\<end\>,' .. + \ '\<repeat\>:\<until\>,' .. + \ '\%(--\)\=\[\(=*\)\[:]\1]' + let b:undo_ftplugin ..= " | unlet! b:match_words b:match_ignorecase" endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "Lua Source Files (*.lua)\t*.lua\n" . - \ "All Files (*.*)\t*.*\n" - let b:undo_ftplugin .= " | unlet! b:browsefilter" + let b:browsefilter = "Lua Source Files (*.lua)\t*.lua\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 noet: diff --git a/runtime/ftplugin/lynx.vim b/runtime/ftplugin/lynx.vim new file mode 100644 index 0000000000..b76c69f0ae --- /dev/null +++ b/runtime/ftplugin/lynx.vim @@ -0,0 +1,29 @@ +" Vim filetype plugin file +" Language: Lynx Web Browser Configuration +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2022 Sep 09 + +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 cms< com< fo<" + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Lynx Configuration Files (lynx.cfg .lynxrc)\tlynx.cfg;.lynxrc\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 noet: diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index d7a08a9941..277ce3c0b3 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -17,12 +17,12 @@ setlocal iskeyword=@-@,:,a-z,A-Z,48-57,_,.,-,(,) setlocal nonumber norelativenumber setlocal foldcolumn=0 colorcolumn=0 nolist nofoldenable -setlocal tagfunc=man#goto_tag +setlocal tagfunc=v:lua.require'man'.goto_tag if !exists('g:no_plugin_maps') && !exists('g:no_man_maps') nnoremap <silent> <buffer> j gj nnoremap <silent> <buffer> k gk - nnoremap <silent> <buffer> gO :call man#show_toc()<CR> + nnoremap <silent> <buffer> gO :lua require'man'.show_toc()<CR> nnoremap <silent> <buffer> <2-LeftMouse> :Man<CR> if get(b:, 'pager') nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>q diff --git a/runtime/ftplugin/markdown.vim b/runtime/ftplugin/markdown.vim index fc1d9e068b..2b963f139d 100644 --- a/runtime/ftplugin/markdown.vim +++ b/runtime/ftplugin/markdown.vim @@ -1,7 +1,7 @@ " Vim filetype plugin -" Language: Markdown -" Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2019 Dec 05 +" Language: Markdown +" Maintainer: Tim Pope <https://github.com/tpope/vim-markdown> +" Last Change: 2022 Oct 13 if exists("b:did_ftplugin") finish @@ -9,18 +9,33 @@ endif runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim +let s:keepcpo= &cpo +set cpo&vim + setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s--> setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o -setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]: +setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\} if exists('b:undo_ftplugin') - let b:undo_ftplugin .= "|setl cms< com< fo< flp<" + let b:undo_ftplugin .= "|setl cms< com< fo< flp< et< ts< sts< sw<" else - let b:undo_ftplugin = "setl cms< com< fo< flp<" + let b:undo_ftplugin = "setl cms< com< fo< flp< et< ts< sts< sw<" +endif + +if get(g:, 'markdown_recommended_style', 1) + setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4 +endif + +if !exists("g:no_plugin_maps") && !exists("g:no_markdown_maps") + nnoremap <silent><buffer> [[ :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR> + nnoremap <silent><buffer> ]] :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR> + xnoremap <silent><buffer> [[ :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR> + xnoremap <silent><buffer> ]] :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR> + let b:undo_ftplugin .= '|sil! nunmap <buffer> [[|sil! nunmap <buffer> ]]|sil! xunmap <buffer> [[|sil! xunmap <buffer> ]]' endif function! s:NotCodeBlock(lnum) abort - return synIDattr(synID(v:lnum, 1, 1), 'name') !=# 'markdownCode' + return synIDattr(synID(a:lnum, 1, 1), 'name') !=# 'markdownCode' endfunction function! MarkdownFold() abort @@ -64,11 +79,14 @@ function! MarkdownFoldText() abort return hash_indent.' '.title.' '.linecount endfunction -if has("folding") && exists("g:markdown_folding") +if has("folding") && get(g:, "markdown_folding", 0) setlocal foldexpr=MarkdownFold() setlocal foldmethod=expr setlocal foldtext=MarkdownFoldText() - let b:undo_ftplugin .= " foldexpr< foldmethod< foldtext<" + let b:undo_ftplugin .= "|setl foldexpr< foldmethod< foldtext<" endif +let &cpo = s:keepcpo +unlet s:keepcpo + " vim:set sw=2: diff --git a/runtime/ftplugin/mermaid.vim b/runtime/ftplugin/mermaid.vim new file mode 100644 index 0000000000..fe84ab37cf --- /dev/null +++ b/runtime/ftplugin/mermaid.vim @@ -0,0 +1,49 @@ +" Vim filetype plugin +" Language: Mermaid +" Maintainer: Craig MacEachern <https://github.com/craigmac/vim-mermaid> +" Last Change: 2022 Oct 13 + +if exists("b:did_ftplugin") + finish +endif + +let s:keepcpo= &cpo +set cpo&vim + +" Use mermaid live editor's style +setlocal expandtab +setlocal shiftwidth=2 +setlocal softtabstop=-1 +setlocal tabstop=4 + +" TODO: comments, formatlist stuff, based on what? +setlocal comments=b:#,fb:- +setlocal commentstring=#\ %s +setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o +setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\} + +if exists('b:undo_ftplugin') + let b:undo_ftplugin .= "|setl cms< com< fo< flp< et< ts< sts< sw<" +else + let b:undo_ftplugin = "setl cms< com< fo< flp< et< ts< sts< sw<" +endif + +if !exists("g:no_plugin_maps") && !exists("g:no_markdown_maps") + nnoremap <silent><buffer> [[ :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR> + nnoremap <silent><buffer> ]] :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR> + xnoremap <silent><buffer> [[ :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR> + xnoremap <silent><buffer> ]] :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR> + let b:undo_ftplugin .= '|sil! nunmap <buffer> [[|sil! nunmap <buffer> ]]|sil! xunmap <buffer> [[|sil! xunmap <buffer> ]]' +endif + +" if has("folding") && get(g:, "markdown_folding", 0) +" setlocal foldexpr=MarkdownFold() +" setlocal foldmethod=expr +" setlocal foldtext=MarkdownFoldText() +" let b:undo_ftplugin .= "|setl foldexpr< foldmethod< foldtext<" +" endif + +let &cpo = s:keepcpo +unlet s:keepcpo + +" vim:set sw=2: diff --git a/runtime/ftplugin/obse.vim b/runtime/ftplugin/obse.vim new file mode 100644 index 0000000000..6d865f05ee --- /dev/null +++ b/runtime/ftplugin/obse.vim @@ -0,0 +1,70 @@ +" Vim filetype plugin file +" Language: Oblivion Language (obl) +" Original Creator: Kat <katisntgood@gmail.com> +" Maintainer: Kat <katisntgood@gmail.com> +" Created: August 08, 2021 +" Last Change: 13 November 2022 + +if exists("b:did_ftplugin") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +let b:undo_ftplugin = "setl com< cms<" + +noremap <script> <buffer> <silent> [[ <nop> +noremap <script> <buffer> <silent> ]] <nop> + +noremap <script> <buffer> <silent> [] <nop> +noremap <script> <buffer> <silent> ][ <nop> + +setlocal commentstring=;%s +setlocal comments=:; + +function s:NextSection(type, backwards, visual) + if a:visual + normal! gv + endif + + if a:type == 1 + let pattern = '\v(\n\n^\S|%^)' + let flags = 'e' + elseif a:type == 2 + let pattern = '\v^\S.*' + let flags = '' + endif + + if a:backwards + let dir = '?' + else + let dir = '/' + endif + + execute 'silent normal! ' . dir . pattern . dir . flags . "\r" +endfunction + +noremap <script> <buffer> <silent> ]] + \ :call <SID>NextSection(1, 0, 0)<cr> + +noremap <script> <buffer> <silent> [[ + \ :call <SID>NextSection(1, 1, 0)<cr> + +noremap <script> <buffer> <silent> ][ + \ :call <SID>NextSection(2, 0, 0)<cr> + +noremap <script> <buffer> <silent> [] + \ :call <SID>NextSection(2, 1, 0)<cr> + +vnoremap <script> <buffer> <silent> ]] + \ :<c-u>call <SID>NextSection(1, 0, 1)<cr> +vnoremap <script> <buffer> <silent> [[ + \ :<c-u>call <SID>NextSection(1, 1, 1)<cr> +vnoremap <script> <buffer> <silent> ][ + \ :<c-u>call <SID>NextSection(2, 0, 1)<cr> +vnoremap <script> <buffer> <silent> [] + \ :<c-u>call <SID>NextSection(2, 1, 1)<cr> + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/openvpn.vim b/runtime/ftplugin/openvpn.vim new file mode 100644 index 0000000000..56c0f25b39 --- /dev/null +++ b/runtime/ftplugin/openvpn.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: OpenVPN +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Last Change: 2022 Oct 16 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal iskeyword+=-,.,/ +setlocal comments=:#,:; commentstring=#%s + +let b:undo_ftplugin = 'setl isk< com< cms<' diff --git a/runtime/ftplugin/poefilter.vim b/runtime/ftplugin/poefilter.vim new file mode 100644 index 0000000000..92c2def630 --- /dev/null +++ b/runtime/ftplugin/poefilter.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: PoE item filter +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Last Change: 2022 Oct 07 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/racket.vim b/runtime/ftplugin/racket.vim new file mode 100644 index 0000000000..3aa413397e --- /dev/null +++ b/runtime/ftplugin/racket.vim @@ -0,0 +1,82 @@ +" Vim filetype plugin +" Language: Racket +" Maintainer: D. Ben Knoble <ben.knoble+github@gmail.com> +" Previous Maintainer: Will Langstroth <will@langstroth.com> +" URL: https://github.com/benknoble/vim-racket +" Last Change: 2022 Aug 29 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +" quick hack to allow adding values +setlocal iskeyword=@,!,#-',*-:,<-Z,a-z,~,_,94 + +" Enable auto begin new comment line when continuing from an old comment line +setlocal comments=:;;;;,:;;;,:;;,:; +setlocal formatoptions+=r + +"setlocal commentstring=;;%s +setlocal commentstring=#\|\ %s\ \|# + +setlocal formatprg=raco\ fmt + +" Undo our settings when the filetype changes away from Racket +" (this should be amended if settings/mappings are added above!) +let b:undo_ftplugin = + \ "setlocal iskeyword< lispwords< lisp< comments< formatoptions< formatprg<" + \. " | setlocal commentstring<" + +if !exists("no_plugin_maps") && !exists("no_racket_maps") + " Simply setting keywordprg like this works: + " setlocal keywordprg=raco\ docs + " but then vim says: + " "press ENTER or type a command to continue" + " We avoid the annoyance of having to hit enter by remapping K directly. + function s:RacketDoc(word) abort + execute 'silent !raco docs --' shellescape(a:word) + redraw! + endfunction + nnoremap <buffer> <Plug>RacketDoc :call <SID>RacketDoc(expand('<cword>'))<CR> + nmap <buffer> K <Plug>RacketDoc + + " For the visual mode K mapping, it's slightly more convoluted to get the + " selected text: + function! s:Racket_visual_doc() + try + let l:old_a = @a + normal! gv"ay + call system("raco docs '". @a . "'") + redraw! + return @a + finally + let @a = l:old_a + endtry + endfunction + + xnoremap <buffer> <Plug>RacketDoc :call <SID>Racket_visual_doc()<cr> + xmap <buffer> K <Plug>RacketDoc + + let b:undo_ftplugin .= + \ " | silent! execute 'nunmap <buffer> K'" + \. " | silent! execute 'xunmap <buffer> K'" +endif + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = + \ "Racket Source Files (*.rkt *.rktl)\t*.rkt;*.rktl\n" + \. "All Files (*.*)\t*.*\n" + let b:undo_ftplugin .= " | unlet! b:browsefilter" +endif + +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_words = '#|:|#' + let b:undo_ftplugin .= " | unlet! b:match_words" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/readline.vim b/runtime/ftplugin/readline.vim index e9ef93ec7f..eba7122347 100644 --- a/runtime/ftplugin/readline.vim +++ b/runtime/ftplugin/readline.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file -" Language: readline(3) configuration file -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2008-07-09 +" Language: readline(3) configuration file +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 2022 Dec 09 if exists("b:did_ftplugin") finish @@ -11,9 +12,25 @@ 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 com< cms< fo<" -setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_ignorecase = 0 + let b:match_words = '$if:$else:$endif' + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" +endif + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Readline Intialization Files (inputrc .inputrc)\tinputrc;*.inputrc\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 noet: diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim index 93a46f63e2..b6fdb8f3e2 100644 --- a/runtime/ftplugin/sh.vim +++ b/runtime/ftplugin/sh.vim @@ -1,12 +1,12 @@ " Vim filetype plugin file -" Language: sh -" -" 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: sh +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Dan Sharp +" Last Change: 2022 Sep 07 + +if exists("b:did_ftplugin") + finish +endif let b:did_ftplugin = 1 " Make sure the continuation lines below do not cause problems in @@ -14,28 +14,35 @@ let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo-=C -setlocal commentstring=#%s +setlocal comments=:# +setlocal commentstring=#\ %s +setlocal formatoptions-=t formatoptions+=croql + +let b:undo_ftplugin = "setl com< cms< fo<" " Shell: thanks to Johannes Zellner -if exists("loaded_matchit") - let s:sol = '\%(;\s*\|^\s*\)\@<=' " start of line - let b:match_words = - \ s:sol.'if\>:' . s:sol.'elif\>:' . s:sol.'else\>:' . s:sol. 'fi\>,' . - \ s:sol.'\%(for\|while\)\>:' . s:sol. 'done\>,' . - \ s:sol.'case\>:' . s:sol. 'esac\>' +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_ignorecase = 0 + let s:sol = '\%(;\s*\|^\s*\)\@<=' " start of line + let b:match_words = + \ s:sol .. 'if\>:' .. s:sol.'elif\>:' .. s:sol.'else\>:' .. s:sol .. 'fi\>,' .. + \ s:sol .. '\%(for\|while\)\>:' .. s:sol .. 'done\>,' .. + \ s:sol .. 'case\>:' .. s:sol .. 'esac\>' + unlet s:sol + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" endif " Change the :browse e filter to primarily show shell-related files. -if has("gui_win32") - let b:browsefilter="Bourne Shell Scripts (*.sh)\t*.sh\n" . - \ "Korn Shell Scripts (*.ksh)\t*.ksh\n" . - \ "Bash Shell Scripts (*.bash)\t*.bash\n" . - \ "All Files (*.*)\t*.*\n" +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Bourne Shell Scripts (*.sh)\t*.sh\n" .. + \ "Korn Shell Scripts (*.ksh)\t*.ksh\n" .. + \ "Bash Shell Scripts (*.bash)\t*.bash\n" .. + \ "All Files (*.*)\t*.*\n" + let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif -" Undo the stuff we changed. -let b:undo_ftplugin = "setlocal cms< | unlet! b:browsefilter b:match_words" - " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo + +" vim: nowrap sw=2 sts=2 ts=8 noet: diff --git a/runtime/ftplugin/ssa.vim b/runtime/ftplugin/ssa.vim new file mode 100644 index 0000000000..04cc7a9bde --- /dev/null +++ b/runtime/ftplugin/ssa.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: SubStation Alpha +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Last Change: 2022 Oct 10 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:;,:!: commentstring=;\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/vdf.vim b/runtime/ftplugin/vdf.vim new file mode 100644 index 0000000000..973d7c0e48 --- /dev/null +++ b/runtime/ftplugin/vdf.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: Valve Data Format +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Last Change: 2022 Sep 15 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:// commentstring=//\ %s +setl foldmethod=syntax + +let b:undo_ftplugin = 'setl com< cms< fdm<' diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 772899cb42..b64bb55d68 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Vim " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2022 Aug 4 +" Last Change: 2022 Nov 27 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -98,7 +98,7 @@ if exists("loaded_matchit") " func name " require a parenthesis following, then there can be an "endfunc". let b:match_words = - \ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' . + \ '\<\%(fu\%[nction]\|def\)!\=\s\+\S\+\s*(:\%(\%(^\||\)\s*\)\@<=\<retu\%[rn]\>:\%(\%(^\||\)\s*\)\@<=\<\%(endf\%[unction]\|enddef\)\>,' . \ '\<\(wh\%[ile]\|for\)\>:\%(\%(^\||\)\s*\)\@<=\<brea\%[k]\>:\%(\%(^\||\)\s*\)\@<=\<con\%[tinue]\>:\%(\%(^\||\)\s*\)\@<=\<end\(w\%[hile]\|fo\%[r]\)\>,' . \ '\<if\>:\%(\%(^\||\)\s*\)\@<=\<el\%[seif]\>:\%(\%(^\||\)\s*\)\@<=\<en\%[dif]\>,' . \ '{:},' . diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim new file mode 100644 index 0000000000..e740a52849 --- /dev/null +++ b/runtime/ftplugin/zig.vim @@ -0,0 +1,66 @@ +" Vim filetype plugin file +" Language: Zig +" Upstream: https://github.com/ziglang/zig.vim + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif + +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 +setlocal softtabstop=4 +setlocal shiftwidth=4 + +setlocal formatoptions-=t formatoptions+=croql + +setlocal suffixesadd=.zig,.zir + +if has('comments') + setlocal comments=:///,://!,://,:\\\\ + setlocal commentstring=//\ %s +endif + +if has('find_in_path') + let &l:includeexpr='substitute(v:fname, "^([^.])$", "\1.zig", "")' + let &l:include='\v(\@import>|\@cInclude>|^\s*\#\s*include)' +endif + +let &l:define='\v(<fn>|<const>|<var>|^\s*\#\s*define)' + +if !exists('g:zig_std_dir') && exists('*json_decode') && executable('zig') + silent let s:env = system('zig env') + if v:shell_error == 0 + let g:zig_std_dir = json_decode(s:env)['std_dir'] + endif + unlet! s:env +endif + +if exists('g:zig_std_dir') + let &l:path = &l:path . ',' . g:zig_std_dir +endif + +let b:undo_ftplugin = + \ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<' + +augroup vim-zig + autocmd! * <buffer> + autocmd BufWritePre <buffer> if get(g:, 'zig_fmt_autosave', 1) | call zig#fmt#Format() | endif +augroup END + +let b:undo_ftplugin .= '|au! vim-zig * <buffer>' + +let &cpo = s:cpo_orig +unlet s:cpo_orig +" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab diff --git a/runtime/ftplugin/zimbu.vim b/runtime/ftplugin/zimbu.vim index e365ccf07e..cbe2f55572 100644 --- a/runtime/ftplugin/zimbu.vim +++ b/runtime/ftplugin/zimbu.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Zimbu " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2021 Nov 12 +" Last Change: 2022 Sep 07 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -28,7 +28,7 @@ endif " Set 'comments' to format dashed lists in comments. " And to keep Zudocu comment characters. -setlocal comments=sO:#\ -,mO:#\ \ ,:#=,:#-,:#%,:# +setlocal comments=sO:#\ -,mO:#\ \ ,exO:#/,s:/*,m:\ ,ex:*/,:#=,:#-,:#%,:# setlocal errorformat^=%f\ line\ %l\ col\ %c:\ %m,ERROR:\ %m diff --git a/runtime/ftplugin/zsh.vim b/runtime/ftplugin/zsh.vim index 34410f1c62..0ca8077305 100644 --- a/runtime/ftplugin/zsh.vim +++ b/runtime/ftplugin/zsh.vim @@ -2,7 +2,7 @@ " Language: Zsh shell script " Maintainer: Christian Brabandt <cb@256bit.org> " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2020-09-01 +" Latest Revision: 2021-04-03 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-zsh |