blob: 6f301699589cf13a9f3b3353dc17c72f697fa741 [file] [log] [blame]
Bram Moolenaarc236c162008-07-13 17:41:49 +00001" Vim filetype plugin
Bram Moolenaar543b7ef2013-06-01 14:50:56 +02002" Language: Haml
3" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
Bram Moolenaarc08ee742019-12-05 22:47:25 +01004" Last Change: 2019 Dec 05
Bram Moolenaarc236c162008-07-13 17:41:49 +00005
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"
17let s:match_words = ""
18
19runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
20unlet! b:did_ftplugin
Bram Moolenaar543b7ef2013-06-01 14:50:56 +020021set matchpairs-=<:>
Bram Moolenaarc236c162008-07-13 17:41:49 +000022
23" Override our defaults if these were set by an included ftplugin.
24if exists("b:undo_ftplugin")
25 let s:undo_ftplugin = b:undo_ftplugin
26 unlet b:undo_ftplugin
27endif
28if exists("b:browsefilter")
29 let s:browsefilter = b:browsefilter
30 unlet b:browsefilter
31endif
32if exists("b:match_words")
33 let s:match_words = b:match_words
34 unlet b:match_words
35endif
36
37runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
38let b:did_ftplugin = 1
39
Bram Moolenaarc08ee742019-12-05 22:47:25 +010040let &l:define .= empty(&l:define ? '' : '\|') . '^\s*\%(%\w*\)\=\%(\.[[:alnum:]_-]\+\)*#'
41
Bram Moolenaarc236c162008-07-13 17:41:49 +000042" Combine the new set of values with those previously included.
43if exists("b:undo_ftplugin")
44 let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
45endif
46if exists ("b:browsefilter")
47 let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
48endif
49if exists("b:match_words")
50 let s:match_words = b:match_words . ',' . s:match_words
51endif
52
53" Change the browse dialog on Win32 to show mainly Haml-related files
54if has("gui_win32")
55 let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter
56endif
57
58" Load the combined list of match_words for matchit.vim
59if exists("loaded_matchit")
60 let b:match_words = s:match_words
61endif
62
Bram Moolenaar7a329912010-05-21 12:05:36 +020063setlocal comments= commentstring=-#\ %s
Bram Moolenaarc236c162008-07-13 17:41:49 +000064
Bram Moolenaarc08ee742019-12-05 22:47:25 +010065let b:undo_ftplugin = "setl def< cms< com< "
Bram Moolenaarc236c162008-07-13 17:41:49 +000066 \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
67
68let &cpo = s:save_cpo
Bram Moolenaar84f72352012-03-11 15:57:40 +010069unlet s:save_cpo
Bram Moolenaarc236c162008-07-13 17:41:49 +000070
71" vim:set sw=2: