From 77c59f64e3022c82614293c6c46b0f681f59b4d1 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 28 Apr 2014 14:04:47 -0400 Subject: vimrc: add JavaScript syntax highlighting for JSON files * Create an augroup to house syntax highlighting settings * Add an autocmd that highlights JSON files using JavaScript syntax highlighting --- vimrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vimrc b/vimrc index c7e9142..8614fd5 100644 --- a/vimrc +++ b/vimrc @@ -85,6 +85,11 @@ " * Set ignorecase and smartcase " * Add file encoding to statusline " +" 2014.04.28: +" * Add augroup for custom syntax highlighting by filetype +" * Add autocmd to set .json files to use JavaScript syntax highlighting +" and have a json filetype +" " Pathogen @@ -357,6 +362,14 @@ command! -nargs=* Wrap set wrap linebreak nolist " autocmd bufwritepost .vimrc source $MYVIMRC " endif +" Filetype syntax highlighting +augroup filetype_syntax_highlighting + autocmd! + + " Set JSON files to JavaScript syntax + autocmd BufRead,BufNewFile *.json set filetype=json syntax=javascript +augroup END + " Project Settings -- cgit v1.2.3