Fork me on GitHub
#spacemacs
<
2023-09-04
>
Black09:09:00

Is there a way to sort map as you can sort namespace , r s n ? I tryied to define macro which uses vim :sort but it is not reliable a<return><escape>k%i<return><escape>l%jVk%k:sort<return>[Jh%kJ , also this will only sort maps where each line is simple :key :value

jahson11:09:56

If you have LSP then you can use , a a, sort.

❤️ 2
jahson11:09:54

Not sure if it can be bound to some key combination.

practicalli-johnny15:09:17

Perhaps sort-line Emacs command may work, assuming each key/value pair is on its own line.

Black19:09:48

Sure, when key/pair is on each line I can make it work, it would be nice to have some more robust solution. Yet to explore @U071CG4QY ´s solution.

Black11:09:10

@U071CG4QY's solution works perfectly! thanks

👍 2