combobulate icon indicating copy to clipboard operation
combobulate copied to clipboard

Cycling yaml indentations

Open lerouxrgd opened this issue 1 year ago • 5 comments

It would be nice to have a function similar to combobulate-python-indent-for-tab-command in yaml (probably called combobulate-yaml-indent-for-tab-command).

I am not too familiar with neither combobulate nor treesit yet, but if you have some pointers about how to implement it I could give it a try.

lerouxrgd avatar Aug 14 '23 00:08 lerouxrgd

That's a great idea. The only caveat is that yaml-ts-mode does not have an indentation engine at all!

I need to change combobulate so it'll work on non-ts-modes, then you can at least use the third-party yaml-mode to do indentation and then combobulate can maybe use that.

mickeynp avatar Aug 17 '23 09:08 mickeynp

Actually there is yaml-pro that achieves similar results using treesit in the functions yaml-pro-ts-indent-subtree and yaml-pro-ts-unindent-subtree.

lerouxrgd avatar Aug 17 '23 10:08 lerouxrgd

And the non-ts yaml-mode can already cycle indentations :). Perhaps we should spend some effort on giving yaml-ts-mode a basic indentation function using tree-sitter first?

wyuenho avatar Sep 07 '23 21:09 wyuenho

Indeed. It shouldn't take more than a few hours to write one, to be honest. Using Combobulate's query builder to help match things should make things easier!

mickeynp avatar Sep 08 '23 05:09 mickeynp

For indentation in yaml-ts-mode, I just use indent-rigidly with C-x TAB after selecting a region, though I haven't tried it after selecting a node with combobulator.

dcunited001 avatar Oct 04 '23 12:10 dcunited001