meson.vim 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. " Vim filetype plugin file
  2. " Language: meson
  3. " License: VIM License
  4. " Maintainer: Liam Beguin <liambeguin@gmail.com>
  5. " Original Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  6. " Last Change: 2018 Nov 27
  7. " 2024 Jan 14 by Vim Project (browsefilter)
  8. if exists("b:did_ftplugin") | finish | endif
  9. let b:did_ftplugin = 1
  10. let s:keepcpo= &cpo
  11. set cpo&vim
  12. setlocal commentstring=#\ %s
  13. setlocal comments=:#
  14. setlocal formatoptions+=croql formatoptions-=t
  15. let b:undo_ftplugin = "setl com< cms< fo<"
  16. if get(g:, "meson_recommended_style", 1)
  17. setlocal expandtab
  18. setlocal shiftwidth=2
  19. setlocal softtabstop=2
  20. let b:undo_ftplugin .= " | setl et< sts< sw<"
  21. endif
  22. if exists("loaded_matchit") && !exists("b:match_words")
  23. let b:match_words = '\<if\>:\<elif\>:\<else\>:\<endif\>,' .
  24. \ '\<foreach\>:\<break\>:\<continue\>:\<endforeach\>'
  25. let b:undo_ftplugin .= " | unlet! b:match_words"
  26. endif
  27. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  28. let b:browsefilter = "Meson Build Files (meson.build)\tmeson.build\n"
  29. if has("win32")
  30. let b:browsefilter .= "All Files (*.*)\t*\n"
  31. else
  32. let b:browsefilter .= "All Files (*)\t*\n"
  33. endif
  34. let b:undo_ftplugin .= " | unlet! b:browsefilter"
  35. endif
  36. let &cpo = s:keepcpo
  37. unlet s:keepcpo