meson.vim 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. if exists("b:did_ftplugin") | finish | endif
  8. let b:did_ftplugin = 1
  9. let s:keepcpo= &cpo
  10. set cpo&vim
  11. setlocal commentstring=#\ %s
  12. setlocal comments=:#
  13. setlocal formatoptions+=croql formatoptions-=t
  14. let b:undo_ftplugin = "setl com< cms< fo<"
  15. if get(g:, "meson_recommended_style", 1)
  16. setlocal expandtab
  17. setlocal shiftwidth=2
  18. setlocal softtabstop=2
  19. let b:undo_ftplugin .= " | setl et< sts< sw<"
  20. endif
  21. if exists("loaded_matchit") && !exists("b:match_words")
  22. let b:match_words = '\<if\>:\<elif\>:\<else\>:\<endif\>,' .
  23. \ '\<foreach\>:\<break\>:\<continue\>:\<endforeach\>'
  24. let b:undo_ftplugin .= " | unlet! b:match_words"
  25. endif
  26. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  27. let b:browsefilter = "Meson Build Files (meson.build)\tmeson.build\n" .
  28. \ "All Files (*.*)\t*.*\n"
  29. let b:undo_ftplugin .= " | unlet! b:browsefilter"
  30. endif
  31. let &cpo = s:keepcpo
  32. unlet s:keepcpo