aboutsummaryrefslogtreecommitdiff
path: root/base/vim/ftplugin/json.vim
diff options
context:
space:
mode:
authorAdam Hovorka <[email protected]>2018-07-18 11:16:36 -0600
committerAdam Hovorka <[email protected]>2018-07-18 11:16:36 -0600
commit189738a11cab0657724d853ba1b0bb85a034e3bc (patch)
tree9fb562a8c1cc4903809300cbf78de6c0fa396b86 /base/vim/ftplugin/json.vim
parentc817818569ee99df20763d250a9d0cd4eb1d59d9 (diff)
Open JSON folds by default
Diffstat (limited to 'base/vim/ftplugin/json.vim')
-rw-r--r--base/vim/ftplugin/json.vim37
1 files changed, 15 insertions, 22 deletions
diff --git a/base/vim/ftplugin/json.vim b/base/vim/ftplugin/json.vim
index 3ee1062..1ae1b99 100644
--- a/base/vim/ftplugin/json.vim
+++ b/base/vim/ftplugin/json.vim
@@ -1,40 +1,33 @@
-" Vim syntax file
-" Language: JSON
-" Maintainer: Eli Parra <[email protected]> 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
+ let g:vim_json_syntax_conceal = 1
end
"have warnings by default
if !exists("g:vim_json_warnings")
- let g:vim_json_warnings = 1
+ 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 = ""
+ 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
+ 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
setlocal foldmethod=syntax
+normal zR