update filetypes for yaml languages

This commit is contained in:
2026-03-14 14:37:04 +02:00
parent a28dafa553
commit 0931940cfa
4 changed files with 27 additions and 26 deletions

View File

@@ -9,7 +9,6 @@
"gitsigns.nvim": { "branch": "main", "commit": "6bd29494e3f79ff08be1d35bc1926ed23c22ed9a" }, "gitsigns.nvim": { "branch": "main", "commit": "6bd29494e3f79ff08be1d35bc1926ed23c22ed9a" },
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" }, "gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
"hererocks": { "branch": "master", "commit": "3856f1b4fb69a9f683f1eb146a4cd49a67478419" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },

View File

@@ -1,27 +1,25 @@
vim.filetype.add({ vim.filetype.add({
extension = { extension = {
['tf'] = 'terraform', ['tf'] = 'terraform',
},
pattern = {
['.*/playbooks/.*%.ya?ml'] = 'yaml_ansible',
['.*/roles/.*%.ya?ml'] = 'yaml_ansible',
['.*/tasks/.*%.ya?ml'] = 'yaml_ansible',
['.*/plays/.*%.ya?ml'] = 'yaml_ansible',
},
})
vim.filetype.add({
extension = {
j2 = 'jinja', j2 = 'jinja',
jinja = 'jinja', jinja = 'jinja',
jinja2 = 'jinja', jinja2 = 'jinja',
} },
}) pattern = {
['.*/playbooks/.*%.ya?ml'] = 'yaml.ansible',
vim.filetype.add({ ['.*/roles/.*%.ya?ml'] = 'yaml.ansible',
pattern = { ['.*/tasks/.*%.ya?ml'] = 'yaml.ansible',
['%.gitlab%-ci%.ya?ml'] = 'yaml_gitlab', ['.*/plays/.*%.ya?ml'] = 'yaml.ansible',
['pipelines/.*%.ya?ml'] = 'yaml_gitlab', -- templates
}, ['.*/templates/.*%.ya?ml'] = 'helm',
['.*/templates/.*%.tpl'] = 'helm',
['helmfile%.ya?ml'] = 'helm',
-- values files
['.*/helm/.*values.*%.ya?ml'] = 'yaml.helm-values',
['values%.ya?ml'] = 'yaml.helm-values',
-- gitlab-ci
['%.gitlab%-ci%.ya?ml'] = 'yaml.gitlab',
['pipelines/.*%.ya?ml'] = 'yaml.gitlab',
},
}) })

View File

@@ -33,8 +33,6 @@ return {
---@type MasonLspconfigSettings ---@type MasonLspconfigSettings
require('mason-lspconfig').setup({ require('mason-lspconfig').setup({
automatic_enable = true, automatic_enable = true,
-- Replace the language servers listed here
-- with the ones you want to install
ensure_installed = { ensure_installed = {
'ts_ls', 'ts_ls',
'lua_ls', 'lua_ls',
@@ -58,7 +56,7 @@ return {
---@type lspconfig.Config ---@type lspconfig.Config
vim.lsp.config('pylsp', { vim.lsp.config('pylsp', {
settings = { settings = {
['pylsp'] = { pylsp = {
plugins = { plugins = {
autopep8 = { autopep8 = {
enabled = false, enabled = false,
@@ -77,13 +75,19 @@ return {
vim.lsp.config('helm_ls', { vim.lsp.config('helm_ls', {
settings = { settings = {
['helm_ls'] = { helm_ls = {
helmLint = { enabled = false },
yamlls = { enabled = false }, yamlls = { enabled = false },
}, },
} }
}) })
vim.lsp.config('yamlls', {
filetypes = { 'yaml' },
settings = {
yaml = { enable = true, },
}
})
vim.lsp.config('terraformls', { vim.lsp.config('terraformls', {
filetypes = { 'terraform', 'terraform-vars' }, filetypes = { 'terraform', 'terraform-vars' },
-- run terraformls once for a git repo -- run terraformls once for a git repo

View File

@@ -22,7 +22,6 @@ return {
"vimdoc", "vimdoc",
"latex", "latex",
"json", "json",
"yaml",
"git_config", "git_config",
"git_rebase", "git_rebase",
"gitattributes", "gitattributes",
@@ -43,6 +42,7 @@ return {
} }
ts.setup() ts.setup()
ts.install(installed_parsers) ts.install(installed_parsers)
vim.treesitter.language.register('yaml', 'yaml_gitlab')
end end
} }