aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorTeddy Wing2014-04-28 14:04:47 -0400
committerTeddy Wing2014-04-28 14:04:47 -0400
commit77c59f64e3022c82614293c6c46b0f681f59b4d1 (patch)
treefd1410f693a3df95fee3b23ed09f3654f8aa6abd /vimrc
parent0f8c89760b75232d82379c22765d208168c8fd74 (diff)
downloaddotvim-77c59f64e3022c82614293c6c46b0f681f59b4d1.tar.bz2
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
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc13
1 files changed, 13 insertions, 0 deletions
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