mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Add folding support for JSON files
This commit is contained in:
parent
6c873a32da
commit
ee38046ebc
6
after/ftplugin/json.vim
Normal file
6
after/ftplugin/json.vim
Normal file
@ -0,0 +1,6 @@
|
||||
" let the initial folding state be that all folds are closed.
|
||||
set foldlevel=0
|
||||
|
||||
" Use nvim-treesitter for folding
|
||||
set foldmethod=expr
|
||||
set foldexpr=nvim_treesitter#foldexpr()
|
||||
@ -1,5 +1,5 @@
|
||||
require("nvim-treesitter.configs").setup {
|
||||
ensure_installed = { "python", "cpp", "lua", "vim" },
|
||||
ensure_installed = { "python", "cpp", "lua", "vim", "json" },
|
||||
ignore_install = {}, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
|
||||
@ -45,3 +45,6 @@ function! s:md_to_pdf() abort
|
||||
echoerr "Error running command"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" json format
|
||||
command! -range JSONFormat <line1>,<line2>!python -m json.tool
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user