neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

haml.vim (2119B)


      1 " Vim filetype plugin
      2 " Language:	Haml
      3 " Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
      4 " Last Change:	2019 Dec 05
      5 "		2024 Jan 14 by Vim Project (browsefilter)
      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 = ""
     17 if has("win32")
     18  let s:browsefilter = "All Files (*.*)\t*\n"
     19 else
     20  let s:browsefilter = "All Files (*)\t*\n"
     21 endif
     22 let s:match_words = ""
     23 
     24 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
     25 unlet! b:did_ftplugin
     26 set matchpairs-=<:>
     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 
     45 let &l:define .= empty(&l:define ? '' : '\|') . '^\s*\%(%\w*\)\=\%(\.[[:alnum:]_-]\+\)*#'
     46 
     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")
     52  let s:browsefilter = substitute(b:browsefilter,'\cAll Files (.*)\t\*\n','','') . s:browsefilter
     53 endif
     54 if exists("b:match_words")
     55  let s:match_words = b:match_words . ',' . s:match_words
     56 endif
     57 
     58 " Change the browse dialog on Win32 and GTK to show mainly Haml-related files
     59 if has("gui_win32") || has("gui_gtk")
     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 
     68 setlocal comments= commentstring=-#\ %s
     69 
     70 let b:undo_ftplugin = "setl def< cms< com< " .
     71      \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
     72 
     73 let &cpo = s:save_cpo
     74 unlet s:save_cpo
     75 
     76 " vim:set sw=2: