Skip to content

A neovim plugin for fast navigation around the abstract syntax tree

License

Notifications You must be signed in to change notification settings

aaronik/treewalker.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build status Static Badge Neovim

Treewalker.nvim

A demo of moving around some code quickly using the plugin

Treewalker is a plugin that gives you the ability to move around your code in a syntax tree aware manner. It uses Treesitter under the hood for syntax tree awareness. It offers four subcommands: Up, Down, Right, and Left. Each command moves through the syntax tree in an intuitive way.

  • Up/Down - Moves up or down to the next neighbor node
  • Right - Finds the next good child node
  • Left - Finds the next good parent node

Moving slowly, showing each command A demo of moving around some code slowly typing out each command


Installation

Lazy:
{
  "aaronik/treewalker.nvim",
  opts = {
    highlight = true -- Whether to briefly highlight the node after jumping to it
  }
}

Mapping

This is how I have mine mapped; in init.lua:

vim.api.nvim_set_keymap('n', '<C-j>', ':Treewalker Down<CR>', { noremap = true })
vim.api.nvim_set_keymap('n', '<C-k>', ':Treewalker Up<CR>', { noremap = true })
vim.api.nvim_set_keymap('n', '<C-h>', ':Treewalker Left<CR>', { noremap = true })
vim.api.nvim_set_keymap('n', '<C-l>', ':Treewalker Right<CR>', { noremap = true })

About

A neovim plugin for fast navigation around the abstract syntax tree

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •