generated from nvim-lua/nvim-lua-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
ansible.lua
26 lines (26 loc) · 748 Bytes
/
ansible.lua
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
if vim.filetype then
vim.filetype.add({
pattern = {
[".*/playbooks/.*%.yml"] = "yaml.ansible",
[".*/playbooks/.*%.yaml"] = "yaml.ansible",
[".*/roles/.*/tasks/.*%.yml"] = "yaml.ansible",
[".*/roles/.*/tasks/.*%.yaml"] = "yaml.ansible",
[".*/roles/.*/handlers/.*%.yml"] = "yaml.ansible",
[".*/roles/.*/handlers/.*%.yaml"] = "yaml.ansible",
}
})
else
vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
pattern = {
"*/playbooks/*.yml",
"*/playbooks/*.yaml",
"*/roles/*/tasks/*.yml",
"*/roles/*/tasks/*.yaml",
"*/roles/*/handlers/*.yml",
"*/roles/*/handlers/*.yaml"
},
callback = function()
vim.bo.filetype = "yaml.ansible"
end,
})
end