Got cfn working nicely
This commit is contained in:
parent
bbc67edf62
commit
6cbbc7bce7
2 changed files with 102 additions and 1 deletions
18
filetype.lua
Normal file
18
filetype.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
vim.filetype.add {
|
||||
pattern = {
|
||||
['.*'] = {
|
||||
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]] ) then
|
||||
return 'yaml.cloudformation'
|
||||
elseif vim.filetype.matchregex(line1, [[["']AWSTemplateFormatVersion]] ) or
|
||||
vim.filetype.matchregex(line2, [[["']AWSTemplateFormatVersion]] ) then
|
||||
return 'json.cloudformation'
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue