aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/lua/vim/filetype.lua34
1 files changed, 29 insertions, 5 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 6ba6b3981d..13da5286c8 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -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