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