• Skip to primary navigation
  • Skip to content
  • Skip to footer
alexdyas
  • Posts
  • Categories
  • Tags
  • About
    Alex Dyas

    Alex Dyas

    Dyas Ex Machina

    • Website
    • GitHub
    • Mastodon

    NeoVim - Tidy YAML on save

    less than 1 minute read

    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(..)' -")
    

    Tags: linux, neovim

    Categories: technical

    Updated: August 26, 2023

    Share on

    X Facebook LinkedIn Bluesky
    Previous Next

    You May Also Enjoy

    Stop MacOS Spotlight indexing external drives

    less than 1 minute read

    Caveat emptor - Some advanced stuff here, follow at your own risk.

    C64 .prg to d64

    less than 1 minute read

    Adding a C64 .prg file to a C64 .d64 disk image so it will be readable in an emulator:

    Force Yarn to ignore SSL ceritifcate issues

    less than 1 minute read

    I’m just putting this here as it wasn’t an immediately clear fix. I was building the Traefik container image from source.

    Copy last command in shell history to clipboard

    less than 1 minute read

    More command line clipboard functionality. This shell function copies the last line in your shell history to the clipboard. # Copy last command from shell hi...

    • Mastodon
    • GitHub
    • Feed
    © 2026 alexdyas. Powered by Jekyll & Minimal Mistakes.