🐛 fix(nvim): ansible filetype detection now works correctly

This commit is contained in:
Sergio Laín 2024-04-02 09:20:04 +02:00
parent cc470f62ed
commit 4aef47abda
No known key found for this signature in database
GPG key ID: 14C9B8080681777B

View file

@ -1,3 +1,22 @@
vim.filetype.add({
pattern = {
[".*/playbooks/.*%.yaml"] = "yaml.ansible",
[".*/playbooks/.*%.yml"] = "yaml.ansible",
[".*/roles/.*/tasks/.*%.yaml"] = "yaml.ansible",
[".*/roles/.*/tasks/.*%.yml"] = "yaml.ansible",
[".*/tasks/.*%.yaml"] = "yaml.ansible",
[".*/tasks/.*%.yml"] = "yaml.ansible",
[".*/vars/.*%.yaml"] = "yaml.ansible",
[".*/vars/.*%.yml"] = "yaml.ansible",
[".*/defaults/.*%.yaml"] = "yaml.ansible",
[".*/defaults/.*%.yml"] = "yaml.ansible",
[".*/handlers/.*%.yaml"] = "yaml.ansible",
[".*/handlers/.*%.yml"] = "yaml.ansible",
[".*/roles/.*/handlers/.*%.yaml"] = "yaml.ansible",
[".*/roles/.*/handlers/.*%.yml"] = "yaml.ansible",
},
})
return {
{ import = "plugins.extras.lang.yaml-extended" },
{ import = "lazyvim.plugins.extras.lang.ansible" },
@ -8,21 +27,6 @@ return {
vim.list_extend(opts.ensure_installed, { "ansible-language-server" })
end,
},
{
"neovim/nvim-lspconfig",
init = function()
vim.filetype.add({
pattern = {
[".*/playbooks/.*%.yaml"] = "yaml.ansible",
[".*/playbooks/.*%.yml"] = "yaml.ansible",
[".*/roles/.*/tasks/.*%.yaml"] = "yaml.ansible",
[".*/roles/.*/tasks/.*%.yml"] = "yaml.ansible",
[".*/roles/.*/handlers/.*%.yaml"] = "yaml.ansible",
[".*/roles/.*/handlers/.*%.yml"] = "yaml.ansible",
},
})
end,
},
{
"mfussenegger/nvim-lint",
opts = {