qml.vim 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. " Vim filetype plugin file
  2. " Language: QML
  3. " Maintainer: Chase Knowlden <haroldknowlden@gmail.com>
  4. " Last Change: 2023 Aug 16
  5. " 2023 Aug 23 by Vim Project (browsefilter)
  6. " 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
  7. if exists( 'b:did_ftplugin' )
  8. finish
  9. endif
  10. let b:did_ftplugin = 1
  11. let s:cpoptions_save = &cpoptions
  12. set cpoptions&vim
  13. " command for undo
  14. let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring<"
  15. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  16. let b:browsefilter =
  17. \ "QML Files (*.qml, *.qbs)\t*.qml;*.qbs\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. " Set 'comments' to format dashed lists in comments.
  26. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
  27. setlocal commentstring=//\ %s
  28. setlocal formatoptions-=t
  29. setlocal formatoptions+=croql
  30. let &cpoptions = s:cpoptions_save
  31. unlet s:cpoptions_save