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