-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfiletype.lua
More file actions
24 lines (24 loc) · 749 Bytes
/
Copy pathfiletype.lua
File metadata and controls
24 lines (24 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
vim.treesitter.language.register("bash", { "tmux", "zsh", "sh" })
vim.treesitter.language.register("markdown", "mdx")
vim.filetype.add({
extension = {
html = function(_, bufnr)
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) or { "" }
local content = table.concat(lines, "\n")
if vim.regex([[{{\|{#\|{%\s.+\s%}\|#}\|}}]]):match_str(content) ~= nil then
return "htmldjango"
end
return "html"
end,
tfstate = "json",
mdx = "mdx",
},
pattern = {
[".*/hypr/.*%.conf"] = "hyprlang",
[".*/templates/.*%.yaml"] = "helm",
[".*/templates/.*%.tpl"] = "helm",
[".*%.blade%.php"] = "blade",
["Dockerfile-.*"] = "dockerfile",
["Jenkinsfile-.*"] = "groovy",
},
})