Skip to content

Commit 0857ea7

Browse files
committed
strings are finally colored differently than numbers & booleans! #37
1 parent fa9942d commit 0857ea7

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

json-test.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@
88
};
99

1010

11-
// normative JSON examples from http://json.org/example.html
11+
//even with concealment, strings and numbers & booleans are distinct
12+
{
13+
"string": "this is a string, with a escaped \" inside",
14+
"string": "500",
15+
"NOT a string": 500,
16+
"string": "true",
17+
"NOT a string": true
18+
}
1219

20+
21+
// normative JSON examples from http://json.org/example.html
1322
{"menu": {
1423
"id": "file",
1524
"value": "File",
@@ -45,6 +54,7 @@
4554
}
4655
}
4756

57+
4858
{"widget": {
4959
"debug": "on",
5060
"window": {

readme.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Specific customizations
1111

1212
* Added distinct **highlighting** for keywords vs values! (This is what made me start this plugin.)
1313
* Added **concealing** of double quotes, for a minimalist [CoffeeScript](http://coffeescript.org/)-inspired look ([CSON](https://github.com/bevry/cson)!).
14+
* ![image](https://cloud.githubusercontent.com/assets/183877/6786803/18143984-d154-11e4-841c-134241f951ae.png) [Strings are colored differently than other numbers & booleans.](https://github.com/elzr/vim-json/issues/37) The disambiguating purpose of double quotes is thus achieved with colors for a cleaner look.
1415
* *This requires Vim 7.3+.* To disable it add `let g:vim_json_syntax_conceal = 0` to your `.vimrc`.
1516
* Added **folding** of `{...}` and `[...]` blocks. To enable it `:setlocal foldmethod=syntax` (do it permanently on the `ftplugin/json.vim` file).
1617
* **JSON-specific warnings** (red highlights):

syntax/json.vim

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ if version >= 508 || !exists("did_json_syn_inits")
101101
hi def link jsonString String
102102
hi def link jsonTest Label
103103
hi def link jsonEscape Special
104-
hi def link jsonNumber Number
104+
hi def link jsonNumber Delimiter
105105
hi def link jsonBraces Delimiter
106106
hi def link jsonNull Function
107-
hi def link jsonBoolean Boolean
107+
hi def link jsonBoolean Delimiter
108108
hi def link jsonKeyword Label
109109

110110
if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)

0 commit comments

Comments
 (0)