X-Git-Url: https://git.r.bdr.sh/rbdr/tree-sitter-api-notation/blobdiff_plain/60e517c96db9fc7c2bedbf04905f16cd253bf4ef..b95c61865da09bf2e98eeb62c82c914f21e36903:/lua/tree-sitter-api-notation.lua diff --git a/lua/tree-sitter-api-notation.lua b/lua/tree-sitter-api-notation.lua index 184cb57..95d5bd5 100644 --- a/lua/tree-sitter-api-notation.lua +++ b/lua/tree-sitter-api-notation.lua @@ -12,9 +12,11 @@ function M.setup() branch = 'main' } } - vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, { - pattern = {'*.api', '*.apinotation'}, - callback = function () vim.opt.filetype = 'api_notation' end + vim.filetype.add({ + extension = { + api = 'api_notation', + apinotation = 'api_notation' + } }) end