You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Plugin that provides region selection using hints on the abstract syntax tree of a document.
Requirements
Neovim 0.7.2+
Treehopper operates on syntax trees. It uses tree-sitter to retrieve the tree
if a parser is available, otherwise it tries to use the built-in LSP client in
Neovim (using the selectionRange functionality).
Manually: You need to download and compile the language specific parsers
using gcc and place the object files into ~/.config/nvim/parser. See
https://tree-sitter.github.io/tree-sitter/
Installation
Install it like any other neovim plugin:
If using vim-plug: Plug mfussenegger/nvim-treehopper
If using packer.nvim: use mfussenegger/nvim-treehopper
Usage
Selecting a region
Define two mappings:
omap <silent> m :<C-U>lua require('tsht').nodes()<CR>
xnoremap <silent> m :lua require('tsht').nodes()<CR>
You can configure which keys are used for hint labels, the first N characters will be taken from the hint_keys and then after that it will restart from a-zA-Z