aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/filetype.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:23:01 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:23:01 +0000
commit142d9041391780ac15b89886a54015fdc5c73995 (patch)
tree0f6b5cac1a60810a03f52826c9e67c9e2780b033 /runtime/lua/vim/filetype.lua
parentad86b5db74922285699ab2a1dbb2ff20e6268a33 (diff)
parent3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff)
downloadrneovim-142d9041391780ac15b89886a54015fdc5c73995.tar.gz
rneovim-142d9041391780ac15b89886a54015fdc5c73995.tar.bz2
rneovim-142d9041391780ac15b89886a54015fdc5c73995.zip
Merge remote-tracking branch 'upstream/master' into userreg
Diffstat (limited to 'runtime/lua/vim/filetype.lua')
-rw-r--r--runtime/lua/vim/filetype.lua69
1 files changed, 52 insertions, 17 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index e204fe8ae2..9293c828b8 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -170,7 +170,7 @@ local extension = {
return require('vim.filetype.detect').bindzone(bufnr, 'dcl')
end,
db = function(path, bufnr)
- return require('vim.filetype.detect').bindzone(bufnr, '')
+ return require('vim.filetype.detect').bindzone(bufnr)
end,
bicep = 'bicep',
bb = 'bitbake',
@@ -190,6 +190,7 @@ local extension = {
BUILD = 'bzl',
qc = 'c',
cabal = 'cabal',
+ capnp = 'capnp',
cdl = 'cdl',
toc = 'cdrtoc',
cfc = 'cf',
@@ -257,6 +258,7 @@ local extension = {
cc = function(path, bufnr)
return vim.g.cynlib_syntax_for_cc and 'cynlib' or 'cpp'
end,
+ cql = 'cqlang',
crm = 'crm',
csx = 'cs',
cs = 'cs',
@@ -326,11 +328,7 @@ local extension = {
end,
eex = 'eelixir',
leex = 'eelixir',
- am = function(path, bufnr)
- if not path:lower():find('makefile%.am$') then
- return 'elf'
- end
- end,
+ am = 'elf',
exs = 'elixir',
elm = 'elm',
elv = 'elvish',
@@ -418,6 +416,7 @@ local extension = {
fs = function(path, bufnr)
return require('vim.filetype.detect').fs(bufnr)
end,
+ fsh = 'fsh',
fsi = 'fsharp',
fsx = 'fsharp',
fusion = 'fusion',
@@ -555,6 +554,7 @@ local extension = {
jov = 'jovial',
jovial = 'jovial',
properties = 'jproperties',
+ jq = 'jq',
slnf = 'json',
json = 'json',
jsonp = 'json',
@@ -564,7 +564,7 @@ local extension = {
json5 = 'json5',
jsonc = 'jsonc',
jsonnet = 'jsonnet',
- libjsonnet = 'jsonnet',
+ libsonnet = 'jsonnet',
jsp = 'jsp',
jl = 'julia',
kv = 'kivy',
@@ -611,7 +611,9 @@ local extension = {
c = function(path, bufnr)
return require('vim.filetype.detect').lpc(bufnr)
end,
- lsl = 'lsl',
+ lsl = function(path, bufnr)
+ return require('vim.filetype.detect').lsl(bufnr)
+ end,
lss = 'lss',
nse = 'lua',
rockspec = 'lua',
@@ -656,6 +658,9 @@ local extension = {
dmt = 'maxima',
wxm = 'maxima',
mel = 'mel',
+ mmd = 'mermaid',
+ mmdc = 'mermaid',
+ mermaid = 'mermaid',
mf = 'mf',
mgl = 'mgl',
mgp = 'mgp',
@@ -674,6 +679,7 @@ local extension = {
DEF = 'modula2',
['m2'] = 'modula2',
mi = 'modula2',
+ lm3 = 'modula3',
ssc = 'monk',
monk = 'monk',
tsc = 'monk',
@@ -722,6 +728,10 @@ local extension = {
nsi = 'nsis',
nsh = 'nsis',
obj = 'obj',
+ obl = 'obse',
+ obse = 'obse',
+ oblivion = 'obse',
+ obscript = 'obse',
mlt = 'ocaml',
mly = 'ocaml',
mll = 'ocaml',
@@ -735,6 +745,7 @@ local extension = {
opam = 'opam',
['or'] = 'openroad',
scad = 'openscad',
+ ovpn = 'openvpn',
ora = 'ora',
org = 'org',
org_archive = 'org',
@@ -935,12 +946,14 @@ local extension = {
ice = 'slice',
score = 'slrnsc',
sol = 'solidity',
+ smali = 'smali',
tpl = 'smarty',
ihlp = 'smcl',
smcl = 'smcl',
hlp = 'smcl',
smith = 'smith',
smt = 'smith',
+ smithy = 'smithy',
sml = 'sml',
spt = 'snobol4',
sno = 'snobol4',
@@ -1009,6 +1022,7 @@ local extension = {
texinfo = 'texinfo',
text = 'text',
tfvars = 'terraform-vars',
+ thrift = 'thrift',
tla = 'tla',
tli = 'tli',
toml = 'toml',
@@ -1053,6 +1067,7 @@ local extension = {
hdl = 'vhdl',
vho = 'vhdl',
vbe = 'vhdl',
+ tape = 'vhs',
vim = 'vim',
vba = 'vim',
mar = 'vmasm',
@@ -1062,6 +1077,7 @@ local extension = {
vue = 'vue',
wat = 'wast',
wast = 'wast',
+ wdl = 'wdl',
wm = 'webmacro',
wbt = 'winbatch',
wml = 'wml',
@@ -1108,6 +1124,7 @@ local extension = {
yang = 'yang',
['z8a'] = 'z8a',
zig = 'zig',
+ zir = 'zir',
zu = 'zimbu',
zut = 'zimbutempl',
zsh = 'zsh',
@@ -1306,6 +1323,7 @@ local filename = {
['GNUmakefile.am'] = 'automake',
['named.root'] = 'bindzone',
WORKSPACE = 'bzl',
+ ['WORKSPACE.bzlmod'] = 'bzl',
BUILD = 'bzl',
['cabal.project'] = 'cabalproject',
['cabal.config'] = 'cabalconfig',
@@ -1361,13 +1379,13 @@ local filename = {
npmrc = 'dosini',
['/etc/yum.conf'] = 'dosini',
['.npmrc'] = 'dosini',
- ['.editorconfig'] = 'dosini',
['/etc/pacman.conf'] = 'confini',
['mpv.conf'] = 'confini',
dune = 'dune',
jbuild = 'dune',
['dune-workspace'] = 'dune',
['dune-project'] = 'dune',
+ ['.editorconfig'] = 'editorconfig',
['elinks.conf'] = 'elinks',
['mix.lock'] = 'elixir',
['filter-rules'] = 'elmfilt',
@@ -1410,6 +1428,7 @@ local filename = {
gnashpluginrc = 'gnash',
gnashrc = 'gnash',
['.gnuplot'] = 'gnuplot',
+ ['go.sum'] = 'gosum',
['go.work'] = 'gowork',
['.gprc'] = 'gp',
['/.gnupg/gpg.conf'] = 'gpg',
@@ -1439,11 +1458,15 @@ local filename = {
['ipf.conf'] = 'ipfilter',
['ipf6.conf'] = 'ipfilter',
['ipf.rules'] = 'ipfilter',
- ['.eslintrc'] = 'json',
- ['.babelrc'] = 'json',
['Pipfile.lock'] = 'json',
['.firebaserc'] = 'json',
['.prettierrc'] = 'json',
+ ['.babelrc'] = 'jsonc',
+ ['.eslintrc'] = 'jsonc',
+ ['.hintrc'] = 'jsonc',
+ ['.jsfmtrc'] = 'jsonc',
+ ['.jshintrc'] = 'jsonc',
+ ['.swrc'] = 'jsonc',
Kconfig = 'kconfig',
['Kconfig.debug'] = 'kconfig',
['lftp.conf'] = 'lftp',
@@ -1458,6 +1481,9 @@ local filename = {
['.sawfishrc'] = 'lisp',
['/etc/login.access'] = 'loginaccess',
['/etc/login.defs'] = 'logindefs',
+ ['.lsl'] = function(path, bufnr)
+ return require('vim.filetype.detect').lsl(bufnr)
+ end,
['.luacheckrc'] = 'lua',
['lynx.cfg'] = 'lynx',
['m3overrides'] = 'm3build',
@@ -1508,6 +1534,7 @@ local filename = {
['.latexmkrc'] = 'perl',
['pf.conf'] = 'pf',
['main.cf'] = 'pfmain',
+ ['main.cf.proto'] = 'pfmain',
pinerc = 'pine',
['.pinercex'] = 'pine',
['.pinerc'] = 'pine',
@@ -1540,6 +1567,9 @@ local filename = {
['.pythonstartup'] = 'python',
['.pythonrc'] = 'python',
SConstruct = 'python',
+ ['.Rprofile'] = 'r',
+ ['Rprofile'] = 'r',
+ ['Rprofile.site'] = 'r',
ratpoisonrc = 'ratpoison',
['.ratpoisonrc'] = 'ratpoison',
inputrc = 'readline',
@@ -1666,6 +1696,8 @@ local filename = {
fglrxrc = 'xml',
['/etc/blkid.tab'] = 'xml',
['/etc/blkid.tab.old'] = 'xml',
+ ['.clang-format'] = 'yaml',
+ ['.clang-tidy'] = 'yaml',
['/etc/zprofile'] = 'zsh',
['.zlogin'] = 'zsh',
['.zlogout'] = 'zsh',
@@ -1779,6 +1811,8 @@ local pattern = {
['.*/etc/DIR_COLORS'] = 'dircolors',
['.*/etc/dnsmasq%.conf'] = 'dnsmasq',
['php%.ini%-.*'] = 'dosini',
+ ['.*/%.aws/config'] = 'confini',
+ ['.*/%.aws/credentials'] = 'confini',
['.*/etc/pacman%.conf'] = 'confini',
['.*/etc/yum%.conf'] = 'dosini',
['.*lvs'] = 'dracula',
@@ -1885,7 +1919,9 @@ local pattern = {
['Prl.*%..*'] = starsetf('jam'),
['.*%.properties_..'] = 'jproperties',
['.*%.properties_.._..'] = 'jproperties',
+ ['org%.eclipse%..*%.prefs'] = 'jproperties',
['.*%.properties_.._.._.*'] = starsetf('jproperties'),
+ ['[jt]sconfig.*%.json'] = 'jsonc',
['Kconfig%..*'] = starsetf('kconfig'),
['.*%.[Ss][Uu][Bb]'] = 'krl',
['lilo%.conf.*'] = starsetf('lilo'),
@@ -2039,6 +2075,7 @@ local pattern = {
['.*%.ml%.cppo'] = 'ocaml',
['.*%.mli%.cppo'] = 'ocaml',
['.*%.opam%.template'] = 'opam',
+ ['.*/openvpn/.*/.*%.conf'] = 'openvpn',
['.*%.[Oo][Pp][Ll]'] = 'opl',
['.*/etc/pam%.conf'] = 'pamconf',
['.*/etc/pam%.d/.*'] = starsetf('pamconf'),
@@ -2281,10 +2318,8 @@ end
---
--- See $VIMRUNTIME/lua/vim/filetype.lua for more examples.
---
---- Note that Lua filetype detection is disabled when |g:do_legacy_filetype| is set.
----
--- Example:
---- <pre>
+--- <pre>lua
--- vim.filetype.add({
--- extension = {
--- foo = 'fooscript',
@@ -2319,8 +2354,8 @@ end
--- })
--- </pre>
---
---- To add a fallback match on contents (see |new-filetype-scripts|), use
---- <pre>
+--- To add a fallback match on contents, use
+--- <pre>lua
--- vim.filetype.add {
--- pattern = {
--- ['.*'] = {
@@ -2432,7 +2467,7 @@ end
--- Each of the three options is specified using a key to the single argument of this function.
--- Example:
---
---- <pre>
+--- <pre>lua
--- -- Using a buffer number
--- vim.filetype.match({ buf = 42 })
---