]> git.r.bdr.sh - rbdr/tree-sitter-api-notation/commitdiff
Update plugin structure
authorRuben Beltran del Rio <redacted>
Wed, 4 Oct 2023 14:21:15 +0000 (16:21 +0200)
committerRuben Beltran del Rio <redacted>
Wed, 4 Oct 2023 14:21:15 +0000 (16:21 +0200)
lua/tree-sitter-api-notation.lua [new file with mode: 0644]
lua/tree-sitter-api-notation/init.lua [deleted file]
plugin/tree-sitter-api-notation.lua [new file with mode: 0644]
plugin/tree-sitter-api-notation.vim [deleted file]

diff --git a/lua/tree-sitter-api-notation.lua b/lua/tree-sitter-api-notation.lua
new file mode 100644 (file)
index 0000000..a314a33
--- /dev/null
@@ -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 (file)
index d21f441..0000000
+++ /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 (file)
index 0000000..66b498d
--- /dev/null
@@ -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 (file)
index e69de29..0000000