diff options
| author | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-05-15 15:01:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-15 15:01:06 +0200 |
| commit | 9c3211119141dd751b7a045f37fb742c19b75cb2 (patch) | |
| tree | d4000f95f0f472478036a89b19a2f55aadbb5fff /README.md | |
| parent | Merge pull request #45 from kyazdani42/refacto-feat/buf-state-update (diff) | |
| parent | Expose internal api. (diff) | |
| download | nvim-treesitter-9c3211119141dd751b7a045f37fb742c19b75cb2.tar nvim-treesitter-9c3211119141dd751b7a045f37fb742c19b75cb2.tar.gz nvim-treesitter-9c3211119141dd751b7a045f37fb742c19b75cb2.tar.bz2 nvim-treesitter-9c3211119141dd751b7a045f37fb742c19b75cb2.tar.lz nvim-treesitter-9c3211119141dd751b7a045f37fb742c19b75cb2.tar.xz nvim-treesitter-9c3211119141dd751b7a045f37fb742c19b75cb2.tar.zst nvim-treesitter-9c3211119141dd751b7a045f37fb742c19b75cb2.zip | |
Merge pull request #54 from kyazdani42/feat/expose-api
Expose internal api.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -102,16 +102,6 @@ require'nvim-treesitter.configs'.setup { scope_decremental = "grm", -- decrement to the previous scope } }, - node_movement = { -- allows cursor movement in node hierarchy - enable = true, - disable = { 'cpp', 'rust' }, - keymaps = { -- mappings for scope movement (normal mappings) - parent_scope = "<a-k>", -- default is to move with alt key hold - child_scope = "<a-j>", - next_scope = "<a-h>", - previous_scope = "<a-l>", - } - }, ensure_installed = 'all' -- one of 'all', 'language', or a list of languages } EOF @@ -136,12 +126,25 @@ Some of these features are : - [x] Incremental selection - [ ] Syntax based code folding - [x] Consistent syntax highlighting (the api is not quite stable yet) - - [x] Cursor movement in scope hierachy - [x] Statusline indicator (`require'nvim-treesitter'.statusline(size)`) You can find the roadmap [here](https://github.com/nvim-treesitter/nvim-treesitter/projects/1). The roadmap and all features of this plugin are open to change, and any suggestion will be highly appreciated! +## Api + +Nvim-treesitter exposes an api to extend node capabilites. You can retrieve the api like this: +```lua +local ts_node_api = require 'nvim-treesitter'.get_node_api() +``` + +You can also retrieve the current state of the current buffer with: +```lua +local buf_state = require'nvim-treesitter'.get_buf_state() +``` + +More information is available in neovim documentation (`:help nvim-treesitter-api`). + ## Supported Languages For treesitter to work, we need to use query files such as those you can find in `queries/{lang}/{locals,highlights}.scm` |
