try to use ansiblels for ansible only

This commit is contained in:
Oliver Ladner 2024-03-14 08:54:46 +01:00
commit 8072531a1e
3 changed files with 13 additions and 6 deletions

View file

@ -109,11 +109,6 @@ return {
local lua_opts = lsp_zero.nvim_lua_ls()
require("lspconfig").lua_ls.setup(lua_opts)
end,
--ansiblels = function()
-- require("lspconfig").ansiblels.setup({
-- filetypes = "yaml",
-- })
--end,
},
})
end,

View file

@ -69,3 +69,15 @@ vim.opt.splitright = true
-- Mode is shown in lualine, so we don't need it one line below
vim.opt.showmode = false
-- Hobo way to to force ansiblels being used for Ansible files
vim.filetype.add({
pattern = {
[".*/.*playbook.*.ya?ml"] = "yaml.ansible",
[".*/.*tasks.*/.*ya?ml"] = "yaml.ansible",
[".*/.*group_vars.*/.*ya?ml"] = "yaml.ansible",
[".*/.*host_vars.*/.*ya?ml"] = "yaml.ansible",
[".*/local.ya?ml"] = "yaml.ansible",
[".*-ansible/.*ya?ml"] = "yaml.ansible",
},
})

View file

@ -13,7 +13,7 @@ vim.keymap.set("n", "<leader>fo", ":Telescope oldfiles<CR>", { noremap = true, d
vim.keymap.set(
"n",
"<leader>ff",
":Telescope find_files hidden=true no_ignore=true<CR>",
":Telescope find_files hidden=true no_ignore=false<CR>",
{ noremap = true, desc = "File search" }
)