Neovim plugin for treesitter based navigation and selection. Takes inspiration from ParEdit.
Requires neovim >= 0.10.
Key binding | Action | Demo |
---|---|---|
leader-k |
Populate the quick fix with all branches required to reach the current node | :TCShowControlFlow |
Diff two visual selections based on their AST difference. Requires that difft is available in your path.
To use, make your first selection and call :TCDiffThis
, then make your second selection and call :TCDiffThis
again.
tc-diff-this.webm
Populate the quick fix with all branches required to reach the current node.
tc-show-control-flow.mp4
Use your preferred package manager, or the built-in package system (:help packages
).
mkdir -p ~/.config/nvim/pack/dkendal/opt
cd ~/.config/nvim/pack/dkendal/opt
git clone https://github.com/dkendal/nvim-treeclimber.git
-- ~/.config/nvim/init.lua
vim.cmd.packadd('nvim-treeclimber')
require('nvim-treeclimber').setup()
If you want to change the default keybindings, call require('nvim-treeclimber')
rather than calling setup.
See configuration.
To use default highlight, keymaps, and commands call require('nvim-treeclimber').setup()
.
To manually specify the configuration options, take a look at the contents of lua/nvim-treeclimber.lua
and import or modify the portions that you need.
For example, if you just want the built in user commands and highlights but you want your own keybindings, you can do the following:
local tc = require('nvim-treeclimber')
tc.setup_augroups()
tc.setup_user_commands()
-- Copied from setup_keymaps
vim.keymap.set("n", "<leader>k", tc.show_control_flow, {})
vim.keymap.set({ "x", "o" }, "i.", tc.select_current_node, { desc = "select current node" })
vim.keymap.set({ "x", "o" }, "a.", tc.select_expand, { desc = "select parent node" })
...
Copyright Dylan Kendal 2022.