Skip to content

Commit

Permalink
revert: "feat(nvim): add filetype plugin"
Browse files Browse the repository at this point in the history
This reverts commit d5488a3.

The plugin repo doesn't seem to be maintained and the complex
mappings are not working either.
  • Loading branch information
beiertu-mms committed Jan 31, 2024
1 parent 999ffa5 commit ac88bd0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
29 changes: 29 additions & 0 deletions .config/nvim/lua/core/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,32 @@ vim.api.nvim_create_autocmd({ 'BufWritePre' }, {
vim.fn.mkdir(vim.fn.fnamemodify(file, ':p:h'), 'p')
end,
})

-- Set terraform-vars filetype to terraform
vim.api.nvim_create_autocmd('BufEnter', {
group = augroup('set_filetype_of_tfvars'),
pattern = '*',
callback = function()
if vim.bo.filetype == 'terraform-vars' then
vim.opt_local.filetype = 'terraform'
end
end,
})

-- Set filetype to helm when the file is in certain paths
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
group = augroup('set_filetype_of_helm'),
pattern = { '*/templates/*.yaml', '*/templates/*.tpl', '*.gotmpl', 'helmfile*.yaml' },
callback = function()
vim.opt_local.filetype = 'helm'
end,
})

-- Set filetype to sh for zsh file ending
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
group = augroup('set_filetype_of_shell'),
pattern = { '*.zsh' },
callback = function()
vim.opt_local.filetype = 'sh'
end,
})
20 changes: 0 additions & 20 deletions .config/nvim/lua/plugins/filetype.lua

This file was deleted.

0 comments on commit ac88bd0

Please sign in to comment.