Skip to content

Instantly share code, notes, and snippets.

@mbailey
Created May 30, 2017 09:57
Show Gist options
  • Save mbailey/2f7c878eed123cab6fb125117f35aecc to your computer and use it in GitHub Desktop.
Save mbailey/2f7c878eed123cab6fb125117f35aecc to your computer and use it in GitHub Desktop.
yamlise - see YAML when editing JSON files in VIM
" yamlise - see YAML when editing JSON files in vim.
"
" Created for people with JSON phobia, this should
" only be used when all attempts to master JSON
" have failed. http://www.json.org/
"
" I hope it isn't too late for these folks!
" 'Please. This is critical for us.'
" https://github.com/aws/aws-cli/issues/2275#issuecomment-277829948
"
" Installation
" ============
" 1. Install cfn-flip https://github.com/awslabs/aws-cfn-template-flip
" 2. Include this file in your ~/.vimrc
" 3. vim cloudformation-params.json
" YOU SHOULD NOW SEE THE YAML YOU CRAVE
" 4. :wq
" The file should now contain the JSON Amazon CLI expects
"
:augroup yamlise
: autocmd!
: autocmd BufReadPost,FileReadPost *.json '[,']!cfn-flip
: autocmd BufWritePre,FileWritePre *.json '[,']!cfn-flip
: autocmd FileAppendPre *.json '[,']!cfn-flip
:augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment