stylus.vim 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. " Vim filetype plugin
  2. " Language: Stylus
  3. " Maintainer: Marc Harter
  4. " Credits: Tim Pope
  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. runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
  15. unlet! b:did_ftplugin
  16. " Override our defaults if these were set by an included ftplugin.
  17. if exists("b:undo_ftplugin")
  18. let s:undo_ftplugin = b:undo_ftplugin
  19. unlet b:undo_ftplugin
  20. endif
  21. if exists("b:browsefilter")
  22. let s:browsefilter = b:browsefilter
  23. unlet b:browsefilter
  24. endif
  25. " Change the browse dialog on Win32 to show mainly Styl-related files
  26. if has("gui_win32")
  27. let b:browsefilter="Stylus Files (*.styl)\t*.styl\n" . s:browsefilter
  28. endif
  29. setlocal comments= commentstring=//\ %s
  30. setlocal suffixesadd=.styl
  31. setlocal formatoptions+=r
  32. " Add '-' and '#' to the what makes up a keyword.
  33. " This means that 'e' and 'w' work properly now, for properties
  34. " and valid variable names.
  35. setl iskeyword+=#,-
  36. " Add a Stylus command (to see if it's valid)
  37. command -buffer Stylus !clear; cat % |stylus
  38. let b:undo_ftplugin = "setl sua< isk< cms< com< fo< "
  39. \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
  40. let &cpo = s:save_cpo
  41. " vim:set sw=2: