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