From: Ruben Beltran del Rio Date: Wed, 4 Oct 2023 14:21:15 +0000 (+0200) Subject: Update plugin structure X-Git-Url: https://git.r.bdr.sh/rbdr/tree-sitter-api-notation/commitdiff_plain/7e8e1a0ccb55135ae4fadf134f3cc2a5ef92e71a?ds=sidebyside;hp=95610c21f6d00484a1bb76723dc5500593f4846c Update plugin structure --- diff --git a/lua/tree-sitter-api-notation.lua b/lua/tree-sitter-api-notation.lua new file mode 100644 index 0000000..a314a33 --- /dev/null +++ b/lua/tree-sitter-api-notation.lua @@ -0,0 +1,19 @@ + +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 diff --git a/lua/tree-sitter-api-notation/init.lua b/lua/tree-sitter-api-notation/init.lua deleted file mode 100644 index d21f441..0000000 --- a/lua/tree-sitter-api-notation/init.lua +++ /dev/null @@ -1,12 +0,0 @@ -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 -}) diff --git a/plugin/tree-sitter-api-notation.lua b/plugin/tree-sitter-api-notation.lua new file mode 100644 index 0000000..66b498d --- /dev/null +++ b/plugin/tree-sitter-api-notation.lua @@ -0,0 +1 @@ +require('tree-sitter-api-notation').setup() diff --git a/plugin/tree-sitter-api-notation.vim b/plugin/tree-sitter-api-notation.vim deleted file mode 100644 index e69de29..0000000