From 86abb4fc53b643b2ce52f73b7e3b9e0f1cb47dba Mon Sep 17 00:00:00 2001 From: Georgi Dimitrov Date: Thu, 15 Feb 2024 19:02:36 +0000 Subject: [PATCH] neovim: set ft to helm for yaml files in certain locations --- nvim/lua/user/autocmd.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nvim/lua/user/autocmd.lua b/nvim/lua/user/autocmd.lua index 4eb30944..118f1d95 100644 --- a/nvim/lua/user/autocmd.lua +++ b/nvim/lua/user/autocmd.lua @@ -27,4 +27,15 @@ vim.api.nvim_create_autocmd({ 'TextYankPost' }, { end, }) +-- Set filetype to helm for YAML files in certain locations {{{1 +vim.api.nvim_create_augroup('user_filetype_helm', { clear = true }) +vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, { + group = 'user_filetype_helm', + desc = 'set filetype to helm for YAML files in certain locations', + pattern = { '*/templates/*.yaml', '*/templates/*.tpl' }, + callback = function() + vim.opt_local.filetype = 'helm' + end, +}) + --- }}}