-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfiletype.lua
More file actions
29 lines (27 loc) · 1.08 KB
/
filetype.lua
File metadata and controls
29 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- vim.filetype.add {
-- pattern = {
-- ['.*%.ya?ml'] = { -- Matches .yaml and .yml files
-- priority = math.huge,
-- function(path, bufnr)
-- local line1 = vim.filetype.getlines(bufnr, 1)
-- if vim.filetype.matchregex(line1, [[^AWSTemplateFormatVersion]]) or
-- vim.filetype.matchregex(line1, [[AWS::Serverless-2016-10-31]]) then
-- return 'yaml.cloudformation'
-- end
-- end,
-- },
-- ['.*%.json'] = { -- Matches .json files
-- priority = math.huge,
-- function(path, bufnr)
-- local line1 = vim.filetype.getlines(bufnr, 1)
-- local line2 = vim.filetype.getlines(bufnr, 2)
-- if vim.filetype.matchregex(line1, [[["']AWSTemplateFormatVersion]]) or
-- vim.filetype.matchregex(line2, [[["']AWSTemplateFormatVersion]]) or
-- vim.filetype.matchregex(line1, [[AWS::Serverless-2016-10-31]]) or
-- vim.filetype.matchregex(line2, [[AWS::Serverless-2016-10-31]]) then
-- return 'json.cloudformation'
-- end
-- end,
-- },
-- },
-- }