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.rubyforge.org 6" Anon CVS: See above site 7" ---------------------------------------------------------------------------- 8 9" Only do this when not done yet for this buffer 10if (exists("b:did_ftplugin")) 11 finish 12endif 13 14let s:save_cpo = &cpo 15set cpo-=C 16 17" Define some defaults in case the included ftplugins don't set them. 18let s:undo_ftplugin = "" 19let s:browsefilter = "Ruby Files (*.rb)\t*.rb\n" . 20 \ "HTML Files (*.html, *.htm)\t*.html;*.htm\n" . 21 \ "All Files (*.*)\t*.*\n" 22let s:match_words = "" 23 24runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim 25unlet b:did_ftplugin 26 27" Override our defaults if these were set by an included ftplugin. 28if exists("b:undo_ftplugin") 29 let s:undo_ftplugin = b:undo_ftplugin 30 unlet b:undo_ftplugin 31endif 32if exists("b:browsefilter") 33 let s:browsefilter = b:browsefilter 34 unlet b:browsefilter 35endif 36if exists("b:match_words") 37 let s:match_words = b:match_words 38 unlet b:match_words 39endif 40 41runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim 42let b:did_ftplugin = 1 43 44" Combine the new set of values with those previously included. 45if exists("b:undo_ftplugin") 46 let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin 47endif 48if exists ("b:browsefilter") 49 let s:browsefilter = b:browsefilter . s:browsefilter 50endif 51if exists("b:match_words") 52 let s:match_words = b:match_words . ',' . s:match_words 53endif 54 55" Change the browse dialog on Win32 to show mainly eRuby-related files 56if has("gui_win32") 57 let b:browsefilter="eRuby Files (*.rhtml)\t*.rhtml\n" . s:browsefilter 58endif 59 60" Load the combined list of match_words for matchit.vim 61if exists("loaded_matchit") 62 let b:match_words = s:match_words 63endif 64 65" TODO: comments= 66setlocal commentstring=<%#%s%> 67 68let b:undo_ftplugin = "setl cms< " 69 \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin 70 71let &cpo = s:save_cpo 72 73" vim: nowrap sw=2 sts=2 ts=8 ff=unix: 74