nvim-gomove icon indicating copy to clipboard operation
nvim-gomove copied to clipboard

[Feature Request] Integration for tree-sitter nodes?

Open MordechaiHadad opened this issue 4 years ago • 2 comments

Basically let's say i have this code:

1:
2: function hello()
3: 	print("hello")
4: end

so if i use the keybind to move hello function up by 1 one line you will up with this:

1: function hello()
2: 	print("hello")
3: end
4:

I know I can achieve this with a block but this imo could be faster when you have ur cursor over hello and it will just move accordingly

MordechaiHadad avatar Jan 04 '22 19:01 MordechaiHadad

This does sound interesting! I am currently very busy with school as break has just ended, but I will spend some time looking into this - although it may require an entirely new plugin or very big refactors.

Edit: Just looked into it a little more and we can probably plug this into the lua/mappings/base.lua functions fairly easily, yay !

I hope other people can place their suggestions here for more preferred behaviors, so I can figure out a proper architecture :)

booperlv avatar Jan 05 '22 04:01 booperlv

This does sound interesting! I am currently very busy with school as break has just ended, but I will spend some time looking into this - although it may require an entirely new plugin or very big refactors.

I hope other people can place their suggestions here for more preferred behaviors, so I can figure out a proper architecture :)

Makes me happy you find this a useful feature, there is one plugin i know that deals with tree-sitter nodes this one: https://github.com/David-Kunz/treesitter-unit

MordechaiHadad avatar Jan 05 '22 10:01 MordechaiHadad