folke / flash.nvim

Navigate your code with search labels, enhanced character motions and Treesitter integration
Apache License 2.0
2.22k stars 27 forks source link

feature: Treesitter: expand selection #335

Open ralph-bergmann opened 2 months ago

ralph-bergmann commented 2 months ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

First, I like the plugin, but I can't use it as often as I wish.

My day-to-day job is developing Flutter apps (written in Dart). There, I have a lot of <Constructor>(). But the Treesitter mode (S) only selects the body of the constructor without the class name:

SCR-20240504-czmq

Is there a way to expand the selection to include the class name? See AnimatedBuilder or MaterialApp.

Describe the solution you'd like

In an ideal world, the plugin would automatically add the name of the constructor to the selection. But it would be enough to have a function to do this manually.

Describe alternatives you've considered

I've tried ; but it doesn't do what I'm looking for.

Additional context

No response

ralph-bergmann commented 2 months ago

I think I have found a way to achieve what I wanted.

  1. select code block with S
  2. jump to the start/end of the selection with O
  3. increase/decrease selection