vim: JSON and JavaScript use syntax foldmethod
dblume

dblume commited on 2025-06-27 20:57:15
Showing 2 changed files, with 2 additions and 2 deletions.

... ...
@@ -330,7 +330,7 @@ if has("autocmd")
330 330
   autocmd FileType python  set foldmethod=indent  " 'za' to fold
331 331
 
332 332
   autocmd FileType c,cpp nmap <buffer> <leader>s :call SwitchSourceHeader()<cr>
333
-  autocmd FileType c,cpp set foldmethod=syntax
333
+  autocmd FileType c,cpp,json,javascript set foldmethod=syntax
334 334
 
335 335
 " https://jeffkreeftmeijer.com/vim-number/
336 336
 " Disabling for now, just keep the mode that was explicitly requested.
... ...
@@ -344,7 +344,7 @@ if has("autocmd")
344 344
   autocmd FileType python  set foldmethod=indent  " 'za' to fold
345 345
 
346 346
   autocmd FileType c,cpp nmap <buffer> <leader>s :call SwitchSourceHeader()<cr>
347
-  autocmd FileType c,cpp set foldmethod=syntax
347
+  autocmd FileType c,cpp,json,javascript set foldmethod=syntax
348 348
 
349 349
 " https://jeffkreeftmeijer.com/vim-number/
350 350
 " Disabling for now, just keep the mode that was explicitly requested.
351 351