Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Configuration for better JSON editing in Vim

Install jsonlint to act as syntastic json checker:

$ npm install jsonlint -g

Tell syntatastic about it:

" in your ~/.vimrc
let g:syntastic_json_checkers = ['jsonlint']

Get some syntax highlighting (also covers ftdetect to set json filetype)

" in your ~/.vimrc
Bundle 'elzr/vim-json'

" Disable fancy concealing of attribute quotes.
let g:vim_json_syntax_conceal = 0

This comment has been minimized.

Copy link

treasonx commented May 22, 2014

Pretty Print JSON

I used to work with large JSON objects and pretty printing within vim was nice.

Install jsontool to make working with JSON easier:

npm install jsontool -g

Add this awesome vim function to your vimrc!

function! PrettyJSON()
  set filetype=json
:command! PrettyJSON :call PrettyJSON()

This comment has been minimized.

Copy link
Owner Author

christoomey commented May 26, 2014

The vim-json plugin just updated with a fix for the Undefined variable: g:vim_json_warnings. elzr/vim-json#32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.