blob: 1c5f14eebe4e024566efd73cf09bbd9950a8da98 [file] [log] [blame]
Philip H2d919d22024-05-01 18:42:11 +02001" 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
7if exists("b:did_ftplugin")
8 finish
9endif
10
11let s:save_cpo = &cpo
12set cpo-=C
13
14" Define some defaults in case the included ftplugins don't set them.
15let s:undo_ftplugin = ""
16let s:browsefilter = "All Files (*.*)\t*.*\n"
17
18runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
19unlet! b:did_ftplugin
20
21" Override our defaults if these were set by an included ftplugin.
22if exists("b:undo_ftplugin")
23 let s:undo_ftplugin = b:undo_ftplugin
24 unlet b:undo_ftplugin
25endif
26if exists("b:browsefilter")
27 let s:browsefilter = b:browsefilter
28 unlet b:browsefilter
29endif
30
31" Change the browse dialog on Win32 to show mainly Styl-related files
32if has("gui_win32")
33 let b:browsefilter="Stylus Files (*.styl)\t*.styl\n" . s:browsefilter
34endif
35
36setlocal comments= commentstring=//\ %s
37setlocal suffixesadd=.styl
38setlocal 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.
43setl iskeyword+=#,-
44
45" Add a Stylus command (to see if it's valid)
46command -buffer Stylus !clear; cat % |stylus
47
48
49let b:undo_ftplugin = "setl sua< isk< cms< com< fo< "
50 \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
51
52let &cpo = s:save_cpo
53
54" vim:set sw=2: