summaryrefslogtreecommitdiffstats
path: root/ftplugin/json.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-07-26 13:50:28 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2016-07-26 13:52:30 +0200
commitacd25ccf95f25ce2d93c92a45c9229531539249d (patch)
tree074d27c8f77c40c4f91c7fdc8db6ad9b0e91e4f1 /ftplugin/json.vim
parent7dd62806a06af3cf2410cd8a4f83205269f279de (diff)
downloadvim-polyglot-acd25ccf95f25ce2d93c92a45c9229531539249d.tar.gz
vim-polyglot-acd25ccf95f25ce2d93c92a45c9229531539249d.zip
Switch to elzr for json syntax, and disable conceal by default
Diffstat (limited to 'ftplugin/json.vim')
-rw-r--r--ftplugin/json.vim42
1 files changed, 42 insertions, 0 deletions
diff --git a/ftplugin/json.vim b/ftplugin/json.vim
new file mode 100644
index 00000000..3f4adccd
--- /dev/null
+++ b/ftplugin/json.vim
@@ -0,0 +1,42 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1
+
+" Vim syntax file
+" Language: JSON
+" Maintainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
+" Last Change: 2014-05-20 added warning toggle
+
+"uncomment to enable folding of `{...}` and `[...]` blocks
+"setlocal foldmethod=syntax
+
+"conceal by default
+if !exists("g:vim_json_syntax_conceal")
+ let g:vim_json_syntax_conceal = 1
+end
+
+"have warnings by default
+if !exists("g:vim_json_warnings")
+ let g:vim_json_warnings = 1
+end
+
+"set concealcursor blank by default
+"this should turn off the concealing in the current line (where the cursor is at),
+"on all modes (normal, visual, insert)
+if !exists("g:vim_json_syntax_concealcursor")
+ let g:vim_json_syntax_concealcursor = ""
+end
+
+if has('conceal')
+ if (g:vim_json_syntax_conceal == 1)
+ "level 2 means concealed text gets completely hidden unless a
+ "replacement is defined (none is defined by us)
+ setlocal conceallevel=2
+ let &l:concealcursor = g:vim_json_syntax_concealcursor
+ else
+ "level 0 means text is shown normally = no concealing
+ setlocal conceallevel=0
+ endif
+ "maybe g:vim_json_syntax_conceal could be settable to 0,1,2 to map
+ "directly to vim's conceallevels? unsure if anyone cares
+endif
+
+endif