haml.vim 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. " Vim filetype plugin
  2. " Language: Haml
  3. " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
  4. " Last Change: 2016 Aug 29
  5. " Only do this when not done yet for this buffer
  6. if exists("b:did_ftplugin")
  7. finish
  8. endif
  9. let s:save_cpo = &cpo
  10. set cpo-=C
  11. " Define some defaults in case the included ftplugins don't set them.
  12. let s:undo_ftplugin = ""
  13. let s:browsefilter = "All Files (*.*)\t*.*\n"
  14. let s:match_words = ""
  15. runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
  16. unlet! b:did_ftplugin
  17. set matchpairs-=<:>
  18. " Override our defaults if these were set by an included ftplugin.
  19. if exists("b:undo_ftplugin")
  20. let s:undo_ftplugin = b:undo_ftplugin
  21. unlet b:undo_ftplugin
  22. endif
  23. if exists("b:browsefilter")
  24. let s:browsefilter = b:browsefilter
  25. unlet b:browsefilter
  26. endif
  27. if exists("b:match_words")
  28. let s:match_words = b:match_words
  29. unlet b:match_words
  30. endif
  31. runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
  32. let b:did_ftplugin = 1
  33. " Combine the new set of values with those previously included.
  34. if exists("b:undo_ftplugin")
  35. let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
  36. endif
  37. if exists ("b:browsefilter")
  38. let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
  39. endif
  40. if exists("b:match_words")
  41. let s:match_words = b:match_words . ',' . s:match_words
  42. endif
  43. " Change the browse dialog on Win32 to show mainly Haml-related files
  44. if has("gui_win32")
  45. let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter
  46. endif
  47. " Load the combined list of match_words for matchit.vim
  48. if exists("loaded_matchit")
  49. let b:match_words = s:match_words
  50. endif
  51. setlocal comments= commentstring=-#\ %s
  52. let b:undo_ftplugin = "setl cms< com< "
  53. \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
  54. let &cpo = s:save_cpo
  55. unlet s:save_cpo
  56. " vim:set sw=2: