stylus.vim (1392B)
1 " Vim filetype plugin 2 " Language: Stylus 3 " Maintainer: Marc Harter 4 " Credits: Tim Pope 5 6 " Only do this when not done yet for this buffer 7 if exists("b:did_ftplugin") 8 finish 9 endif 10 11 let s:save_cpo = &cpo 12 set cpo-=C 13 14 " Define some defaults in case the included ftplugins don't set them. 15 let s:undo_ftplugin = "" 16 let s:browsefilter = "All Files (*.*)\t*.*\n" 17 18 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim 19 unlet! b:did_ftplugin 20 21 " Override our defaults if these were set by an included ftplugin. 22 if exists("b:undo_ftplugin") 23 let s:undo_ftplugin = b:undo_ftplugin 24 unlet b:undo_ftplugin 25 endif 26 if exists("b:browsefilter") 27 let s:browsefilter = b:browsefilter 28 unlet b:browsefilter 29 endif 30 31 " Change the browse dialog on Win32 to show mainly Styl-related files 32 if has("gui_win32") 33 let b:browsefilter="Stylus Files (*.styl)\t*.styl\n" . s:browsefilter 34 endif 35 36 setlocal comments= commentstring=//\ %s 37 setlocal suffixesadd=.styl 38 setlocal formatoptions+=r 39 40 " Add '-' and '#' to the what makes up a keyword. 41 " This means that 'e' and 'w' work properly now, for properties 42 " and valid variable names. 43 setl iskeyword+=#,- 44 45 " Add a Stylus command (to see if it's valid) 46 command -buffer Stylus !clear; cat % |stylus 47 48 49 let b:undo_ftplugin = "setl sua< isk< cms< com< fo< " 50 \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin 51 52 let &cpo = s:save_cpo 53 54 " vim:set sw=2: