xref: /vim-8.2.3635/runtime/ftplugin/eruby.vim (revision bfd8fc05)
1" Vim filetype plugin
2" Language:	eRuby
3" Maintainer:	Doug Kearns <djkea2 at gus.gscit.monash.edu.au>
4" Info:         $Id$
5" URL:          http://vim-ruby.sourceforge.net
6" Anon CVS:     See above site
7" Licence:      GPL (http://www.gnu.org)
8" Disclaimer:
9"    This program is distributed in the hope that it will be useful,
10"    but WITHOUT ANY WARRANTY; without even the implied warranty of
11"    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12"    GNU General Public License for more details.
13" ----------------------------------------------------------------------------
14
15" Only do this when not done yet for this buffer
16if (exists("b:did_ftplugin"))
17  finish
18endif
19
20let s:save_cpo = &cpo
21set cpo-=C
22
23" Define some defaults in case the included ftplugins don't set them.
24let s:undo_ftplugin = ""
25let s:browsefilter = "Ruby Files (*.rb)\t*.rb\n" .
26		   \ "HTML Files (*.html, *.htm)\t*.html;*.htm\n" .
27		   \ "All Files (*.*)\t*.*\n"
28let s:match_words = ""
29
30runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
31unlet b:did_ftplugin
32
33" Override our defaults if these were set by an included ftplugin.
34if exists("b:undo_ftplugin")
35    let s:undo_ftplugin = b:undo_ftplugin
36    unlet b:undo_ftplugin
37endif
38if exists("b:browsefilter")
39    let s:browsefilter = b:browsefilter
40    unlet b:browsefilter
41endif
42if exists("b:match_words")
43    let s:match_words = b:match_words
44    unlet b:match_words
45endif
46
47runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
48let b:did_ftplugin = 1
49
50" Combine the new set of values with those previously included.
51if exists("b:undo_ftplugin")
52    let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
53endif
54if exists ("b:browsefilter")
55    let s:browsefilter = b:browsefilter . s:browsefilter
56endif
57if exists("b:match_words")
58    let s:match_words = b:match_words . ',' . s:match_words
59endif
60
61" Change the browse dialog on Win32 to show mainly eRuby-related files
62if has("gui_win32")
63    let  b:browsefilter="eRuby Files (*.rhtml)\t*.rhtml\n" . s:browsefilter
64endif
65
66" Load the combined list of match_words for matchit.vim
67if exists("loaded_matchit")
68    let b:match_words = s:match_words
69endif
70
71" TODO: comments=
72setlocal commentstring=<%#%s%>
73
74let b:undo_ftplugin = "setl cms< "
75      \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
76
77let &cpo = s:save_cpo
78
79" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
80