NeoVim - Tidy YAML on save
I like my YAML files to be tidied and sorted (see Tidying YAML). What would be great is if your editor, currently NeoVim for me, would do this automatically on save:
-- Sort YAML files on buffer write
vim.cmd("autocmd BufWritePre *.yaml :%! yq --prettyPrint --indent 2 'sort_keys(..)' -")