Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for concatonated/newline-delimited json #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ftdetect/json.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
autocmd BufNewFile,BufRead *.json setlocal filetype=json
autocmd BufNewFile,BufRead *.jsonl setlocal filetype=json
autocmd BufNewFile,BufRead *.jsonp setlocal filetype=json
autocmd BufNewFile,BufRead *.cjson setlocal filetype=json
autocmd BufNewFile,BufRead *.ndjson setlocal filetype=json
autocmd BufNewFile,BufRead *.geojson setlocal filetype=json
autocmd BufNewFile,BufRead *.template setlocal filetype=json
2 changes: 1 addition & 1 deletion syntax/json.vim
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
" Syntax: Watch out for missing commas between elements
syn match jsonMissingCommaError /\("\|\]\|\d\)\zs\_s\+\ze"/
syn match jsonMissingCommaError /\(\]\|\}\)\_s\+\ze"/ "arrays/objects as values
if (expand('%:e') !=? 'jsonl')
if (expand('%:e') !~? '\(cjson\|ndjson\|jsonl\)')
syn match jsonMissingCommaError /}\_s\+\ze{/ "objects as elements in an array
endif
syn match jsonMissingCommaError /\(true\|false\)\_s\+\ze"/ "true/false as value
Expand Down