haml.vim 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. " Vim filetype plugin
  2. " Language: Haml
  3. " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
  4. " Last Change: 2019 Dec 05
  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. let &l:define .= empty(&l:define ? '' : '\|') . '^\s*\%(%\w*\)\=\%(\.[[:alnum:]_-]\+\)*#'
  34. " Combine the new set of values with those previously included.
  35. if exists("b:undo_ftplugin")
  36. let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
  37. endif
  38. if exists ("b:browsefilter")
  39. let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
  40. endif
  41. if exists("b:match_words")
  42. let s:match_words = b:match_words . ',' . s:match_words
  43. endif
  44. " Change the browse dialog on Win32 to show mainly Haml-related files
  45. if has("gui_win32")
  46. let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter
  47. endif
  48. " Load the combined list of match_words for matchit.vim
  49. if exists("loaded_matchit")
  50. let b:match_words = s:match_words
  51. endif
  52. setlocal comments= commentstring=-#\ %s
  53. let b:undo_ftplugin = "setl def< cms< com< "
  54. \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
  55. let &cpo = s:save_cpo
  56. unlet s:save_cpo
  57. " vim:set sw=2: