spacemacs

Black 2023-09-04T09:16:00.425029Z

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

2023-09-04T11:34:56.781159Z

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

❤️ 1
2023-09-04T11:35:54.759399Z

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

practicalli-johnny 2023-09-04T15:54:17.393249Z

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

Black 2023-09-04T19:37:48.340759Z

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 @jahson ´s solution.

Black 2023-09-05T11:28:10.136489Z

@jahson's solution works perfectly! thanks

👍 1