Plugin that provides region selection using hints on the abstract syntax tree of a document. This is intended to be used for pending operator mappings.
- Requires Neovim HEAD/Nightly
- A treesitter parser for each language you plan to use the plugin with.
- Parsers can be installed via nvim-treesitter
TSInstall
- For manual installation, you need to compile the language specific parsers using
gcc
and place the object files into~/.config/nvim/parser
.
- Parsers can be installed via nvim-treesitter
locals
queries for each language you plan to use the plugin with.- nvim-treesitter ships locals queries for many languages. If you've it installed they'll be picked up.
- You can install them manually by placing
locals.scm
query files into~/.config/nvim/queries/<language>/
- nvim-ts-hint-textobject is a plugin. Install it like any other neovim plugin:
- If using vim-plug:
Plug mfussenegger/nvim-ts-hint-textobject
- If using packer.nvim:
use mfussenegger/nvim-ts-hint-textobject
- If using vim-plug:
Define two mapppings:
omap <silent> m :<C-U>lua require('tsht').nodes()<CR>
vnoremap <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
require("tsht").config.hint_keys = { "h", "j", "f", "d", "n", "v", "s", "l", "a" }