Skip to content

Jump to, select and operate on AST nodes via the Leap interface with Treesitter (WIP)

License

Notifications You must be signed in to change notification settings

wstevick/leap-ast.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

leap-ast.nvim

Jump to, select and operate on AST nodes via the Leap interface with Tree-sitter.

Requirements

  • Neovim >= 0.7.0
  • leap.nvim
  • nvim-treesitter (This dependency is only temporary; it will not be necessary in the future.)

Installation

Use your preferred plugin manager - no extra steps needed.

Usage

This plugin allows you to instantly select or jump to the beginning of an AST node. Add something like this to your init.lua.

vim.keymap.set({'n', 'x', 'o'}, '<space>t', function() require'leap-ast'.leap() end, {})

Then, when you're editing a file with a Tree-sitter parser enabled, type <space>t. Labels for each AST node that containing the cursor will appear. In normal mode, entering a label will take you to the beginning of the corresponding node. In visual and operator-pending mode, entering a label will select the corresponding node. This is useful for selecting quickly pieces of code based on syntax, which is usually what you want.

About

Jump to, select and operate on AST nodes via the Leap interface with Treesitter (WIP)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%