nvim-treesitter / nvim-treesitter/nvim-treesitter-textobjects
Per mapping/object options
Nobody has claimed this yet.
- Dominant language
- Tree-sitter Query
- Stars
- 2.8k
- Forks
- 271
- Avg merge
- 8d 8h
- Merged PRs (30d)
- 1
Description
Features like https://github.com/nvim-treesitter/nvim-treesitter-textobjects/pull/150 and https://github.com/nvim-treesitter/nvim-treesitter-textobjects/issues/125 would benefit from being per-mapping/objects instead of global options.
Our current settings look like this
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
}
We could extend them to something like
-- Global options are defined here
-- lookahead = true,
keymaps = {
["af"] = {
textobject = "@function.outer",
-- If these options aren't given the global/default ones
-- are used.
lookahead = true,
auto_expand = true,
},
-- This form is valid, and it uses the global options.
["if"] = "@function.inner"
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing keymap and global-option handling in the plugin, then compare it with the linked textobjects pull request and issue. Define how per-mapping values override defaults while preserving the string form, and verify both forms and fallback behavior with the relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100