Skip to content

daliusd/incr.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

incr.nvim

This plugin uses nvim-treesitter to select nodes incrementally. You can start selection in normal mode by clicking tab and then repeatedly clicking tab select more scope. You can use s-tab to decrement selection.

Installation

Using lazyvim.

  {
    'daliusd/incr.nvim',
    config = true,
  },

If you want to override default keys then use something like this:

  {
    'daliusd/incr.nvim',
    opts = {
        incr_key = '<tab>', -- increment selection key
        decr_key = '<s-tab>', -- decrement selection key
    },
  }

History

nvim-treesitter main branch drop increment selection feature. From nvim-treesitter/nvim-treesitter#4767 (comment):

incremental-selection mostly served as a proof-of-concept for non-highlighting uses of tree-sitter; if people are actively using it, they should consider moving it to a separate plugin (or seeing if textobjects don't serve this purposes even better); alternatively rewrite as simple node and scope textobjects;

This is basically gist of it. Initially I have tried to move this to my nvim configuration as simple solution, but found out that simple solution was lacking something as tree-sitter methods are not necessary doing what their documentation says.

This does not match original nvim-treesitter incremental-selection feature - if you are missing something feel free to create issue or even better PR.

About

tree-sitter incremental selection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages