--- /dev/null
+
+local M = {}
+
+function M.setup()
+ local parser_config = require 'nvim-treesitter.parsers'.get_parser_configs()
+ parser_config.api_notation = {
+ install_info = {
+ url = 'https://git.sr.ht/~rbdr/tree-sitter-api-notation', -- local path or git repo
+ files = {'src/parser.c'},
+ branch = 'main'
+ }
+ }
+ vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, {
+ pattern = {'*.api', '*.apinotation'},
+ callback = function () vim.opt.filetype = 'api_notation' end
+ })
+end
+
+return M
+++ /dev/null
-local parser_config = require 'nvim-treesitter.parsers'.get_parser_configs()
-parser_config.api_notation = {
- install_info = {
- url = 'https://git.sr.ht/~rbdr/tree-sitter-api-notation', -- local path or git repo
- files = {'src/parser.c'},
- branch = 'main'
- }
-}
-vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, {
- pattern = {'*.api', '*.apinotation'},
- callback = function () vim.opt.filetype = 'api_notation' end
-})
--- /dev/null
+require('tree-sitter-api-notation').setup()