blob: 910d9c78b3fb588cc0d553a1562ec6bf33b6853d [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
Doug Kearns93197fd2024-01-14 20:59:02 +01005" 2024 Jan 14 by Vim Project (browsefilter)
Bram Moolenaarc236c162008-07-13 17:41:49 +00006
7" Only do this when not done yet for this buffer
8if exists("b:did_ftplugin")
9 finish
10endif
11
12let s:save_cpo = &cpo
13set cpo-=C
14
15" Define some defaults in case the included ftplugins don't set them.
16let s:undo_ftplugin = ""
Doug Kearns93197fd2024-01-14 20:59:02 +010017if has("win32")
18 let s:browsefilter = "All Files (*.*)\t*\n"
19else
20 let s:browsefilter = "All Files (*)\t*\n"
21endif
Bram Moolenaarc236c162008-07-13 17:41:49 +000022let s:match_words = ""
23
24runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
25unlet! b:did_ftplugin
Bram Moolenaar543b7ef2013-06-01 14:50:56 +020026set matchpairs-=<:>
Bram Moolenaarc236c162008-07-13 17:41:49 +000027
28" Override our defaults if these were set by an included ftplugin.
29if exists("b:undo_ftplugin")
30 let s:undo_ftplugin = b:undo_ftplugin
31 unlet b:undo_ftplugin
32endif
33if exists("b:browsefilter")
34 let s:browsefilter = b:browsefilter
35 unlet b:browsefilter
36endif
37if exists("b:match_words")
38 let s:match_words = b:match_words
39 unlet b:match_words
40endif
41
42runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
43let b:did_ftplugin = 1
44
Bram Moolenaarc08ee742019-12-05 22:47:25 +010045let &l:define .= empty(&l:define ? '' : '\|') . '^\s*\%(%\w*\)\=\%(\.[[:alnum:]_-]\+\)*#'
46
Bram Moolenaarc236c162008-07-13 17:41:49 +000047" Combine the new set of values with those previously included.
48if exists("b:undo_ftplugin")
49 let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
50endif
51if exists ("b:browsefilter")
Doug Kearns93197fd2024-01-14 20:59:02 +010052 let s:browsefilter = substitute(b:browsefilter,'\cAll Files (.*)\t\*\n','','') . s:browsefilter
Bram Moolenaarc236c162008-07-13 17:41:49 +000053endif
54if exists("b:match_words")
55 let s:match_words = b:match_words . ',' . s:match_words
56endif
57
Doug Kearns93197fd2024-01-14 20:59:02 +010058" Change the browse dialog on Win32 and GTK to show mainly Haml-related files
59if has("gui_win32") || has("gui_gtk")
Bram Moolenaarc236c162008-07-13 17:41:49 +000060 let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter
61endif
62
63" Load the combined list of match_words for matchit.vim
64if exists("loaded_matchit")
65 let b:match_words = s:match_words
66endif
67
Bram Moolenaar7a329912010-05-21 12:05:36 +020068setlocal comments= commentstring=-#\ %s
Bram Moolenaarc236c162008-07-13 17:41:49 +000069
Doug Kearns93197fd2024-01-14 20:59:02 +010070let b:undo_ftplugin = "setl def< cms< com< " .
Bram Moolenaarc236c162008-07-13 17:41:49 +000071 \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
72
73let &cpo = s:save_cpo
Bram Moolenaar84f72352012-03-11 15:57:40 +010074unlet s:save_cpo
Bram Moolenaarc236c162008-07-13 17:41:49 +000075
76" vim:set sw=2: