Skip to content

Commit

Permalink
neovim: set ft to helm for yaml files in certain locations
Browse files Browse the repository at this point in the history
  • Loading branch information
geodimm committed Feb 15, 2024
1 parent d2c8f80 commit 926bbdb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nvim/lua/user/autocmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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', '*.gotmpl', 'helmfile*.yaml' },
callback = function()
vim.opt_local.filetype = 'helm'
end,
})

--- }}}

0 comments on commit 926bbdb

Please sign in to comment.