TabTree is a Neovim plugin designed to enhance navigation within code by leveraging the power of Tree-sitter. It allows users to jump between significant code elements, such as brackets, quotes, etc.
Additional language configs welcome as PRs!
Default key bindings for Normal
mode, these should not interfere with nvim-cmp
Insert
mode bindings:
Key | Action |
---|---|
<Tab> |
require('tabtree').next() |
<S-Tab> |
require('tabtree').previous() |
LazyVim example:
{
"roobert/tabtree.nvim",
config = function()
require("tabtree").setup()
end,
},
Override any configuration option by passing an options table to the setup function:
{
"roobert/tabtree.nvim",
config = function()
require("tabtree").setup({
-- print the capture group name when executing next/previous
--debug = true,
-- disable key bindings
--key_bindings_disabled = true,
key_bindings = {
next = "<Tab>",
previous = "<S-Tab>",
},
-- use :InspectTree to discover the (capture group)
-- @capture_name can be anything
language_configs = {
python = {
target_query = [[
(string) @string_capture
(interpolation) @interpolation_capture
(parameters) @parameters_capture
(argument_list) @argument_list_capture
]],
-- experimental feature, to move the cursor in certain situations like when handling python f-strings
offsets = {
string_start_capture = 1,
},
},
},
default_config = {
target_query = [[
(string) @string_capture
(interpolation) @interpolation_capture
(parameters) @parameters_capture
(argument_list) @argument_list_capture
]],
offsets = {},
}
})
end,
},
Inspired by abecodes/tabout.nvim.