diff options
| author | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-04-22 09:14:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-22 09:14:18 +0200 |
| commit | e2a25a313520df8bc259b3b547a7482438645ffe (patch) | |
| tree | b569c95e6d32e24c94012303fd79f284880eab52 /lua/nvim-treesitter.lua | |
| parent | Merge pull request #16 from kyazdani42/fix-compiling-parser (diff) | |
| parent | feat/refacto: add configs.lua, setup install (diff) | |
| download | nvim-treesitter-e2a25a313520df8bc259b3b547a7482438645ffe.tar nvim-treesitter-e2a25a313520df8bc259b3b547a7482438645ffe.tar.gz nvim-treesitter-e2a25a313520df8bc259b3b547a7482438645ffe.tar.bz2 nvim-treesitter-e2a25a313520df8bc259b3b547a7482438645ffe.tar.lz nvim-treesitter-e2a25a313520df8bc259b3b547a7482438645ffe.tar.xz nvim-treesitter-e2a25a313520df8bc259b3b547a7482438645ffe.tar.zst nvim-treesitter-e2a25a313520df8bc259b3b547a7482438645ffe.zip | |
Merge pull request #17 from kyazdani42/add-configs-ft
feat/refacto: add configs.lua, setup install cmd
Diffstat (limited to 'lua/nvim-treesitter.lua')
| -rw-r--r-- | lua/nvim-treesitter.lua | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lua/nvim-treesitter.lua b/lua/nvim-treesitter.lua index 8628e499b..8f2fa05ed 100644 --- a/lua/nvim-treesitter.lua +++ b/lua/nvim-treesitter.lua @@ -1,10 +1,15 @@ local api = vim.api local parsers = require'nvim-treesitter.parsers' +local configs = require 'nvim-treesitter.configs' local install = require'nvim-treesitter.install' local locals = require'nvim-treesitter.locals' local M = {} +function M.available_parsers() + return vim.tbl_keys(configs.repositories) +end + -- This function sets up everythin needed for a given language -- this is the main interface through the plugin function M.setup(lang) @@ -12,9 +17,11 @@ function M.setup(lang) end end --- To install, run `:lua require'nvim-treesitter'.install_parser('language')` --- we should add a vim layer over the lua function -M.install_parser = install.install_parser -M.list_parsers = install.list_parsers +-- This function initialize the plugin +-- it is run at startup +M._root = {} +function M._root.setup() + install.setup() +end return M |
