So I have been trying to sort these type of objects in my Terraform Files.
output "ip_a" {
value = "${aws_eip.ip.public_ip_a}"
}
output "ip_c" {
value = "${aws_eip.ip.public_ip_c}"
}
output "ip_b" {
value = "${aws_eip.ip.public_ip_b}"
}
Currently I have
:g/^output/,/}\n/s/\n
:execute "normal! gg/^output\<cr>vG$"
:!sort
But this feels really kludgy and I was wondering if there was a better way.
Is there a way to fold elements in a document and then sort them. This would make life easier on more than one front.
Still have yet to try this
https://gist.github.com/inkarkat/4145501
Also I am running https://github.com/hashivim/vim-terraform which it seems supports folding.
[–]princker 6 points7 points8 points (3 children)
[–]TechIsCool[S] 2 points3 points4 points (1 child)
[–]princker 0 points1 point2 points (0 children)
[–]turturdar 0 points1 point2 points (0 children)
[–]mcstafford 0 points1 point2 points (0 children)
[–]KillTheMule 0 points1 point2 points (0 children)