aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
commitff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch)
tree729bbcb92231538fa61dab6c3d890b025484b7f5 /runtime/ftplugin
parent376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff)
parent28c04948a1c887a1cc0cb64de79fa32631700466 (diff)
downloadrneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/arduino.vim66
-rw-r--r--runtime/ftplugin/asm.vim14
-rw-r--r--runtime/ftplugin/astro.vim186
-rw-r--r--runtime/ftplugin/bp.vim14
-rw-r--r--runtime/ftplugin/cgdbrc.vim21
-rw-r--r--runtime/ftplugin/checkhealth.vim3
-rw-r--r--runtime/ftplugin/cmake.vim5
-rw-r--r--runtime/ftplugin/dart.vim15
-rw-r--r--runtime/ftplugin/deb822sources.vim16
-rw-r--r--runtime/ftplugin/dts.vim16
-rw-r--r--runtime/ftplugin/gdb.vim12
-rw-r--r--runtime/ftplugin/graphql.vim13
-rw-r--r--runtime/ftplugin/hyprlang.vim13
-rw-r--r--runtime/ftplugin/java.vim60
-rw-r--r--runtime/ftplugin/jj.vim19
-rw-r--r--runtime/ftplugin/jq.vim16
-rw-r--r--runtime/ftplugin/kconfig.vim17
-rw-r--r--runtime/ftplugin/man.vim2
-rw-r--r--runtime/ftplugin/nim.vim13
-rw-r--r--runtime/ftplugin/ondir.vim18
-rw-r--r--runtime/ftplugin/prisma.vim13
-rw-r--r--runtime/ftplugin/purescript.vim14
-rw-r--r--runtime/ftplugin/python.vim23
-rw-r--r--runtime/ftplugin/requirements.vim43
-rw-r--r--runtime/ftplugin/rescript.vim13
-rw-r--r--runtime/ftplugin/roc.vim14
-rw-r--r--runtime/ftplugin/rust.vim31
-rw-r--r--runtime/ftplugin/sh.vim6
-rw-r--r--runtime/ftplugin/slint.vim15
-rw-r--r--runtime/ftplugin/sql.vim5
-rw-r--r--runtime/ftplugin/sshdconfig.vim10
-rw-r--r--runtime/ftplugin/stylus.vim54
-rw-r--r--runtime/ftplugin/tutor.vim2
-rw-r--r--runtime/ftplugin/typst.vim14
-rw-r--r--runtime/ftplugin/uci.vim21
-rw-r--r--runtime/ftplugin/v.vim15
-rw-r--r--runtime/ftplugin/verilog.vim4
-rw-r--r--runtime/ftplugin/vim.vim8
-rw-r--r--runtime/ftplugin/yaml.vim7
-rw-r--r--runtime/ftplugin/zathurarc.vim22
-rw-r--r--runtime/ftplugin/zig.vim60
-rw-r--r--runtime/ftplugin/zsh.vim4
42 files changed, 833 insertions, 104 deletions
diff --git a/runtime/ftplugin/arduino.vim b/runtime/ftplugin/arduino.vim
new file mode 100644
index 0000000000..dae3dd83d3
--- /dev/null
+++ b/runtime/ftplugin/arduino.vim
@@ -0,0 +1,66 @@
+" Vim filetype plugin file
+" Language: Arduino
+" Maintainer: The Vim Project <https://github.com/vim/vim>
+" Ken Takata <https://github.com/k-takata>
+" Last Change: 2024 Apr 12
+"
+" Most of the part was copied from c.vim.
+
+" 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
+
+" Using line continuation here.
+let s:cpo_save = &cpo
+set cpo-=C
+
+let b:undo_ftplugin = "setl fo< com< ofu< cms< def< inc<"
+
+if !exists("g:arduino_recommended_style") || g:arduino_recommended_style != 0
+ " Use the default setting of Arduino IDE.
+ setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2
+ let b:undo_ftplugin ..= " et< ts< sts< sw<"
+endif
+
+" 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
+
+" These options have the right value as default, but the user may have
+" overruled that.
+setlocal commentstring& define& include&
+
+" Set completion with CTRL-X CTRL-O to autoloaded function.
+if exists('&ofu')
+ setlocal ofu=ccomplete#Complete
+endif
+
+" Set 'comments' to format dashed lists in comments.
+" Also include ///, used for Doxygen.
+setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
+
+" When the matchit plugin is loaded, this makes the % command skip parens and
+" braces in comments properly.
+if !exists("b:match_words")
+ let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>'
+ let b:match_skip = 's:comment\|string\|character\|special'
+ let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words"
+endif
+
+" Win32 and GTK can filter files in the browse dialog
+if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
+ let b:browsefilter = "Arduino Source Files (*.ino, *.pde)\t*.ino;*.pde\n"
+ if has("win32")
+ let b:browsefilter ..= "All Files (*.*)\t*\n"
+ else
+ let b:browsefilter ..= "All Files (*)\t*\n"
+ endif
+ let b:undo_ftplugin ..= " | unlet! b:browsefilter"
+endif
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/ftplugin/asm.vim b/runtime/ftplugin/asm.vim
index f6a92d57d7..0ae1610394 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 0000000000..0b0e03447b
--- /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 0000000000..5ddebe5233
--- /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 0000000000..46cf135c5c
--- /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/checkhealth.vim b/runtime/ftplugin/checkhealth.vim
index 4b530e6f7c..62a1970b4a 100644
--- a/runtime/ftplugin/checkhealth.vim
+++ b/runtime/ftplugin/checkhealth.vim
@@ -9,9 +9,6 @@ endif
runtime! ftplugin/help.vim
setlocal wrap breakindent linebreak
-setlocal foldexpr=getline(v:lnum-1)=~'^=\\{78}$'?'>1':(getline(v:lnum)=~'^=\\{78}'?0:'=')
-setlocal foldmethod=expr
-setlocal foldtext=v:lua.require('vim.health').foldtext()
let &l:iskeyword='!-~,^*,^|,^",192-255'
if exists("b:undo_ftplugin")
diff --git a/runtime/ftplugin/cmake.vim b/runtime/ftplugin/cmake.vim
index 94c007629b..9fcf87a759 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/dart.vim b/runtime/ftplugin/dart.vim
new file mode 100644
index 0000000000..42c90c212f
--- /dev/null
+++ b/runtime/ftplugin/dart.vim
@@ -0,0 +1,15 @@
+" Vim filetype plugin
+" Language: dart
+" Maintainer: Riley Bruins <ribru17@gmail.com>
+" Last Change: 2024 May 18
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+" Set 'comments' to format dashed lists in comments.
+" Also include ///, used for Doxygen.
+setl comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// commentstring=//\ %s
+
+let b:undo_ftplugin = 'setl com< cms<'
diff --git a/runtime/ftplugin/deb822sources.vim b/runtime/ftplugin/deb822sources.vim
new file mode 100644
index 0000000000..4936f42bf9
--- /dev/null
+++ b/runtime/ftplugin/deb822sources.vim
@@ -0,0 +1,16 @@
+" Language: Debian sources.list
+" Maintainer: Debian Vim Maintainers <team+vim@tracker.debian.org>
+" Last Change: 2024 Mar 20
+" License: Vim License
+" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/ftplugin/deb822sources.vim
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin=1
+
+setlocal comments=:#
+setlocal commentstring=#%s
+setlocal formatoptions-=t
+
+let b:undo_ftplugin = 'setlocal comments< commentstring< formatoptions<'
diff --git a/runtime/ftplugin/dts.vim b/runtime/ftplugin/dts.vim
new file mode 100644
index 0000000000..42e38338b7
--- /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 2473b13af0..7c10633be4 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/graphql.vim b/runtime/ftplugin/graphql.vim
new file mode 100644
index 0000000000..56f6e36e20
--- /dev/null
+++ b/runtime/ftplugin/graphql.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language: graphql
+" Maintainer: Riley Bruins <ribru17@gmail.com>
+" Last Change: 2024 May 18
+
+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/hyprlang.vim b/runtime/ftplugin/hyprlang.vim
new file mode 100644
index 0000000000..5c186c3c5e
--- /dev/null
+++ b/runtime/ftplugin/hyprlang.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language: hyprlang
+" Maintainer: ribru17 <ribru17@gmail.com>
+" Last Change: 2024 May 18
+
+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/java.vim b/runtime/ftplugin/java.vim
index bb7e7cd72c..fa2b61075f 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/jj.vim b/runtime/ftplugin/jj.vim
new file mode 100644
index 0000000000..cc5d700a30
--- /dev/null
+++ b/runtime/ftplugin/jj.vim
@@ -0,0 +1,19 @@
+" Vim filetype plugin
+" Language: jj description
+" Maintainer: Gregory Anders <greg@gpanders.com>
+" Last Change: 2024 May 8
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+" Use the same formatoptions and textwidth as the gitcommit ftplugin
+setlocal nomodeline formatoptions+=tl textwidth=72
+setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n
+setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}]\\s\\+\\\|^\\s*[-*+]\\s\\+
+
+setlocal comments=b:JJ:
+setlocal commentstring=JJ:\ %s
+
+let b:undo_ftplugin = 'setl modeline< formatoptions< textwidth< formatlistpat< comments< commentstring<'
diff --git a/runtime/ftplugin/jq.vim b/runtime/ftplugin/jq.vim
new file mode 100644
index 0000000000..88958e80dd
--- /dev/null
+++ b/runtime/ftplugin/jq.vim
@@ -0,0 +1,16 @@
+" Vim compiler file
+" Language: jq
+" Maintainer: Vito <vito.blog@gmail.com>
+" Last Change: 2024 Apr 29
+" Upstream: https://github.com/vito-c/jq.vim
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal include=^\\s*\\%(import\\\|include\\)
+setlocal commentstring=#%s
+compiler jq
+
+let b:undo_ftplugin = 'setl commentstring< include<'
diff --git a/runtime/ftplugin/kconfig.vim b/runtime/ftplugin/kconfig.vim
index 940ba7427f..767490701b 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/man.vim b/runtime/ftplugin/man.vim
index 277ce3c0b3..fdeaae4c3f 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -24,7 +24,7 @@ if !exists('g:no_plugin_maps') && !exists('g:no_man_maps')
nnoremap <silent> <buffer> k gk
nnoremap <silent> <buffer> gO :lua require'man'.show_toc()<CR>
nnoremap <silent> <buffer> <2-LeftMouse> :Man<CR>
- if get(b:, 'pager')
+ if get(g:, 'pager')
nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>q
else
nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
diff --git a/runtime/ftplugin/nim.vim b/runtime/ftplugin/nim.vim
new file mode 100644
index 0000000000..4ab8b7b536
--- /dev/null
+++ b/runtime/ftplugin/nim.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language: nim
+" Maintainer: Riley Bruins <ribru17@gmail.com>
+" Last Change: 2024 May 19
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+