json5.vim 815 B

123456789101112131415161718192021222324252627282930313233
  1. " Vim filetype plugin file
  2. " Language: JSON5
  3. " Maintainer: Doug Kearns <dougkearns@gmail.com>
  4. " Last Change: 2024 Jan 14
  5. if exists("b:did_ftplugin")
  6. finish
  7. endif
  8. let b:did_ftplugin = 1
  9. let s:cpo_save = &cpo
  10. set cpo&vim
  11. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
  12. setlocal commentstring=//\ %s
  13. setlocal formatoptions-=t formatoptions+=croql
  14. let b:undo_ftplugin = "setl fo< com< cms<"
  15. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  16. let b:browsefilter = "JSON5 Files (*.json5)\t*.json5\n" ..
  17. \ "JSON Files (*.json)\t*.json\n"
  18. if has("win32")
  19. let b:browsefilter ..= "All Files (*.*)\t*\n"
  20. else
  21. let b:browsefilter ..= "All Files (*)\t*\n"
  22. endif
  23. let b:undo_ftplugin ..= " | unlet! b:browsefilter"
  24. endif
  25. let &cpo = s:cpo_save
  26. unlet s:cpo_save