Add JSON syntax highlighting in Vim on OS X
This is how I got Vim to do syntax highlighting for JSON files (Max OS X - Snow Leopard)
comments powered by
- Download the syntax file from http://www.vim.org/scripts/script.php?script_id=1945. (I got json.vim version 0.4)
- If it doesn't already exist, create a .vim/ftplugin in your home directory.
- Put json.vim into .vim/ftplugin
- Add the following lines in your .vimrc file (mine is located at ~/.vimrc)
au BufRead,BufNewFile *.json set filetype=jsonNote that you'll have to change the path to your json.vim file so that it works on your computer.
au! Syntax json source /Users/brad/.vim/ftplugin/json.vim
- Now, got edit a .json file!