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

Support `CamelCaseMotion`, integrate `nvim-spider`

Open NormTurtle opened this issue 2 years ago • 11 comments

Default behavior of NODES("{[ < is good, but i MOSTY do WORD selection which is not seem to happening

example of wats wrong

https://github.com/SUSTech-data/wildfire.nvim/assets/108952834/e06af664-16d0-4c23-8c8f-c367f7113d74

just give me a way to do so :)

NormTurtle avatar Aug 13 '23 18:08 NormTurtle

Did you mean select the word CamelCaseMotion in the comments?

fecet avatar Aug 14 '23 10:08 fecet

yes , word Based selection but Based on CamelCaseMotion such in that way it would require x3 <CR> to select CamelCaseMotion whole !

NormTurtle avatar Aug 15 '23 17:08 NormTurtle

I think this might be harder to achieve than it looks. Have you seen any plugins do similar things so I can look into it?

fecet avatar Aug 16 '23 11:08 fecet

sorry i think i forgot to inform about nvim-spider in above convo's :(

NVIM-Spider has done it already for motion, you just use it with visual-motion this may make this work easy,

NormTurtle avatar Aug 16 '23 18:08 NormTurtle

OK I will take care of it, maybe add this with custom textobjects. This would introduce inconsistent incremental selection methods (searching for the parent node and searching for the next subword), so I'm still considering how to implement them.

fecet avatar Aug 18 '23 02:08 fecet

sorry but i dont' know what to say now ?! :|

NormTurtle avatar Aug 18 '23 19:08 NormTurtle

I have played with NVIM-Spider for a while, but I cannot make it work in visual mode. If you have slected CamelCase in CamelCaseMotion, can you select CamelCaseMotion by w and Camel by b?

fecet avatar Aug 19 '23 12:08 fecet

@fecet Hi, nvim-spider dev here.

At least for stuff relating to my plugin, I can maybe help out.

chrisgrieser avatar Aug 20 '23 17:08 chrisgrieser

@chrisgrieser Hi, thanks for response, I hadn't expect this.

I don't think there is any bug here, (neither for nvim-spider of course). I just wondering if/how spider works in visual mode, say, in the case

If you have slected CamelCase in CamelCaseMotion, can you select CamelCaseMotion by w and Camel by b?

This is what I had envisioned, but things didn't unfold this way. I'm wondering if it's due to an issue with my setup or if the spider doesn't actually work like this.

I had never used spider before this, but I loved nvim-origami very much, thank you for making so many great plugins!

fecet avatar Aug 21 '23 02:08 fecet

If you have slectedCamelCase inCamelCaseMotion, can you selectCamelCaseMotion by w andCamel by b?

Indeed, it appears in this case b selected CamelC 🤔

I don't use visual mode much, therefore I haven't noticed. But that only happens when using b to reduce a selection, when using b to enlarge a selection, it works correctly. Guess that one is a bug with nvim-spider indeed.

chrisgrieser avatar Aug 21 '23 09:08 chrisgrieser

So, I believe the right approach would be to init wildfire with the subword , then you can employ spider to refine your selection range.

I will proceed with implementing the former, but the latter will have to wait for spider.

fecet avatar Aug 23 '23 01:08 fecet