Merge pull request #16978 from gpanders/filetype-updates

This commit is contained in:
Gregory Anders 2022-01-13 15:58:39 -07:00 committed by GitHub
commit 9b04336445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,7 +119,13 @@ local extension = {
tcc = "cpp",
hxx = "cpp",
hpp = "cpp",
cpp = function()
cpp = function(path, bufnr)
if vim.g.cynlib_syntax_for_cc then
return "cynlib"
end
return "cpp"
end,
cc = function(path, bufnr)
if vim.g.cynlib_syntax_for_cc then
return "cynlib"
end
@ -770,6 +776,14 @@ local extension = {
mm = function() vim.fn["dist#ft#FTmm"]() end,
mms = function() vim.fn["dist#ft#FTmms"]() end,
p = function() vim.fn["dist#ft#FTprogress_pascal"]() end,
patch = function(path, bufnr)
local firstline = getline(bufnr, 1)
if string.find(firstline, "^From " .. string.rep("%x", 40) .. "+ Mon Sep 17 00:00:00 2001$") then
return "gitsendemail"
else
return "diff"
end
end,
pl = function() vim.fn["dist#ft#FTpl"]() end,
pp = function() vim.fn["dist#ft#FTpp"]() end,
pro = function() vim.fn["dist#ft#ProtoCheck"]('idlang') end,
@ -1038,6 +1052,7 @@ local filename = {
["tidy.conf"] = "tidy",
tidyrc = "tidy",
[".tidyrc"] = "tidy",
[".tmux.conf"] = "tmux",
["/.cargo/config"] = "toml",
Pipfile = "toml",
["Gopkg.lock"] = "toml",
@ -1075,6 +1090,7 @@ local filename = {
[".alias"] = function() vim.fn["dist#ft#CSH"]() end,
[".bashrc"] = function() vim.fn["dist#ft#SetFileTypeSH"]("bash") end,
[".cshrc"] = function() vim.fn["dist#ft#CSH"]() end,
[".env"] = function() vim.fn["dist#ft#SetFileTypeSH"](vim.fn.getline(1)) end,
[".kshrc"] = function() vim.fn["dist#ft#SetFileTypeSH"]("ksh") end,
[".login"] = function() vim.fn["dist#ft#CSH"]() end,
[".profile"] = function() vim.fn["dist#ft#SetFileTypeSH"](vim.fn.getline(1)) end,
@ -1232,6 +1248,8 @@ local pattern = {
[".*/%.config/systemd/user/.*%.d/.*%.conf"] = "systemd",
[".*/etc/systemd/system/.*%.d/.*%.conf"] = "systemd",
[".*%.t%.html"] = "tilde",
["%.?tmux.*%.conf"] = "tmux",
["%.?tmux.*%.conf.*"] = { "tmux", { priority = -1 } },
[".*/%.cargo/config"] = "toml",
[".*/%.cargo/credentials"] = "toml",
[".*/etc/udev/udev%.conf"] = "udevconf",
@ -1338,15 +1356,21 @@ local pattern = {
["zlog.*"] = starsetf('zsh'),
["zsh.*"] = starsetf('zsh'),
["ae%d+%.txt"] = 'mail',
["[a-zA-Z0-9]*Dict"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z0-9]*Dict%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z]*Properties"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z]*Properties%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z0-9].*Dict"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z0-9].*Dict%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z].*Properties"] = function() vim.fn["dist#ft#FTfoam"]() end,
["[a-zA-Z].*Properties%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*Transport%..*"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*/constant/g"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*/0/.*"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*/0%.orig/.*"] = function() vim.fn["dist#ft#FTfoam"]() end,
[".*/etc/sensors%.d/[^.].*"] = starsetf('sensors'),
[".*%.git/.*"] = function(path, bufnr)
local firstline = getline(bufnr, 1)
if firstline:find("^" .. string.rep("%x", 40) .. "+ ") or firstline:sub(1, 5) == "ref: " then
return "git"
end
end,
-- END PATTERN
}
-- luacheck: pop