flash.nvim icon indicating copy to clipboard operation
flash.nvim copied to clipboard

feature: More treesitter selection options

Open simonmandlik opened this issue 1 year ago • 8 comments

Did you check the docs?

  • [X] I have read all the flash.nvim docs

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

Would it be possible to customize ; and , keys for treesitter selection? Would it be possible to prevent wrapping when increasing/decreasing selection?

Describe the solution you'd like

A possibility to specify keys e.g. in opts.modes.treesitter.keys.

Setting opts.modes.treesitter.search.wrap to false would prevent wrapping

Describe alternatives you've considered

Additional context

Thank you very much for the great plugin!

simonmandlik avatar Aug 27 '23 14:08 simonmandlik

Would it be possible to customize ; and , keys for treesitter selection?

+1 for this. It seems that ; and , are hard-coded: https://github.com/folke/flash.nvim/blob/48817af25f51c0590653bbc290866e4890fe1cbe/lua/flash/plugins/treesitter.lua#L130-L141 I think it would be natural enough to have a configuration option similar to char_actions: https://github.com/folke/flash.nvim/blob/48817af25f51c0590653bbc290866e4890fe1cbe/lua/flash/config.lua#L194-L205 https://github.com/folke/flash.nvim/blob/48817af25f51c0590653bbc290866e4890fe1cbe/lua/flash/plugins/char.lua#L197-L205

ajvondrak avatar Nov 28 '23 16:11 ajvondrak

Would it be possible to prevent wrapping when increasing/decreasing selection?

+1 on this as well, but I'm having a harder time tracing down which part of the code is responsible for wrapping the node search. 😅 It doesn't seem to be as simple as adding a wrap = false config to places like https://github.com/folke/flash.nvim/blob/48817af25f51c0590653bbc290866e4890fe1cbe/lua/flash/plugins/treesitter.lua#L112 or https://github.com/folke/flash.nvim/blob/48817af25f51c0590653bbc290866e4890fe1cbe/lua/flash/plugins/treesitter.lua#L131-L133 Seems like there might be more logic controlling for it somewhere—maybe get_nodes? Anyway, I assume it's possible, lol.

ajvondrak avatar Nov 28 '23 16:11 ajvondrak

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 06 '24 01:07 github-actions[bot]

please keep

simonmandlik avatar Jul 06 '24 07:07 simonmandlik

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Aug 07 '24 01:08 github-actions[bot]

please keep

simonmandlik avatar Aug 07 '24 09:08 simonmandlik

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Sep 07 '24 01:09 github-actions[bot]

please keep

simonmandlik avatar Sep 08 '24 09:09 simonmandlik

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Oct 09 '24 02:10 github-actions[bot]

please keep

simonmandlik avatar Oct 09 '24 11:10 simonmandlik