Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 1 | " Vim filetype plugin |
Bram Moolenaar | 543b7ef | 2013-06-01 14:50:56 +0200 | [diff] [blame] | 2 | " Language: Haml |
| 3 | " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
Bram Moolenaar | c08ee74 | 2019-12-05 22:47:25 +0100 | [diff] [blame] | 4 | " Last Change: 2019 Dec 05 |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 5 | |
| 6 | " Only do this when not done yet for this buffer |
| 7 | if exists("b:did_ftplugin") |
| 8 | finish |
| 9 | endif |
| 10 | |
| 11 | let s:save_cpo = &cpo |
| 12 | set cpo-=C |
| 13 | |
| 14 | " Define some defaults in case the included ftplugins don't set them. |
| 15 | let s:undo_ftplugin = "" |
| 16 | let s:browsefilter = "All Files (*.*)\t*.*\n" |
| 17 | let s:match_words = "" |
| 18 | |
| 19 | runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim |
| 20 | unlet! b:did_ftplugin |
Bram Moolenaar | 543b7ef | 2013-06-01 14:50:56 +0200 | [diff] [blame] | 21 | set matchpairs-=<:> |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 22 | |
| 23 | " Override our defaults if these were set by an included ftplugin. |
| 24 | if exists("b:undo_ftplugin") |
| 25 | let s:undo_ftplugin = b:undo_ftplugin |
| 26 | unlet b:undo_ftplugin |
| 27 | endif |
| 28 | if exists("b:browsefilter") |
| 29 | let s:browsefilter = b:browsefilter |
| 30 | unlet b:browsefilter |
| 31 | endif |
| 32 | if exists("b:match_words") |
| 33 | let s:match_words = b:match_words |
| 34 | unlet b:match_words |
| 35 | endif |
| 36 | |
| 37 | runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim |
| 38 | let b:did_ftplugin = 1 |
| 39 | |
Bram Moolenaar | c08ee74 | 2019-12-05 22:47:25 +0100 | [diff] [blame] | 40 | let &l:define .= empty(&l:define ? '' : '\|') . '^\s*\%(%\w*\)\=\%(\.[[:alnum:]_-]\+\)*#' |
| 41 | |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 42 | " Combine the new set of values with those previously included. |
| 43 | if exists("b:undo_ftplugin") |
| 44 | let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin |
| 45 | endif |
| 46 | if exists ("b:browsefilter") |
| 47 | let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter |
| 48 | endif |
| 49 | if exists("b:match_words") |
| 50 | let s:match_words = b:match_words . ',' . s:match_words |
| 51 | endif |
| 52 | |
| 53 | " Change the browse dialog on Win32 to show mainly Haml-related files |
| 54 | if has("gui_win32") |
| 55 | let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter |
| 56 | endif |
| 57 | |
| 58 | " Load the combined list of match_words for matchit.vim |
| 59 | if exists("loaded_matchit") |
| 60 | let b:match_words = s:match_words |
| 61 | endif |
| 62 | |
Bram Moolenaar | 7a32991 | 2010-05-21 12:05:36 +0200 | [diff] [blame] | 63 | setlocal comments= commentstring=-#\ %s |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 64 | |
Bram Moolenaar | c08ee74 | 2019-12-05 22:47:25 +0100 | [diff] [blame] | 65 | let b:undo_ftplugin = "setl def< cms< com< " |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 66 | \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin |
| 67 | |
| 68 | let &cpo = s:save_cpo |
Bram Moolenaar | 84f7235 | 2012-03-11 15:57:40 +0100 | [diff] [blame] | 69 | unlet s:save_cpo |
Bram Moolenaar | c236c16 | 2008-07-13 17:41:49 +0000 | [diff] [blame] | 70 | |
| 71 | " vim:set sw=2: |