X-Git-Url: https://git.r.bdr.sh/rbdr/tree-sitter-api-notation/blobdiff_plain/60e517c96db9fc7c2bedbf04905f16cd253bf4ef..75b4720ce734556ef3c13059f16d21d8c5e73e9d:/lua/tree-sitter-api-notation.lua?ds=inline 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