robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
2f5b8a0092
master
1" Vim filetype plugin file 2" Language: Pascal 3" Maintainer: Doug Kearns <dougkearns@gmail.com> 4" Previous Maintainer: Dan Sharp 5" Last Change: 2024 Jan 14 6" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') 7 8if exists ( "b:did_ftplugin" ) |finish |endif 9let b: did_ftplugin = 1 10 11let s: cpo_save = & cpo 12set cpo & vim 13 14set comments = s:(*,m:\ ,e:*),s:{,m:\ ,e:} 15set commentstring = {\ %s\ } 16 17if exists ( "pascal_delphi" ) 18set comments += :/// 19endif 20 21if ! exists ( "pascal_traditional" ) 22set commentstring = //\ %s 23set comments += :// 24endif 25 26setlocal formatoptions -= tformatoptions += croql 27 28if exists ( "loaded_matchit" ) 29let b: match_ignorecase = 1 " (Pascal is case-insensitive) 30 31let b: match_words = '\<\%(asm\|begin\|case\|\%(\%(=\|packed\)\s*\)\@<=\%(class\|object\)\|\%(=\s*\)\@<=interface\|record\|try\)\>' 32let b: match_words .= ':\%(^\s*\)\@<=\%(except\|finally\|else\|otherwise\)\>' 33let b: match_words .= ':\<end\>\.\@!' 34 35let b: match_words .= ',\<repeat\>:\<until\>' 36" let b:match_words .= ',\<if\>:\<else\>' " FIXME - else clashing with middle else. It seems like a debatable use anyway. 37let b: match_words .= ',\<unit\>:\<\%(\%(^\s*\)\@<=interface\|implementation\|initialization\|finalization\)\>:\<end\.' 38endif 39 40if ( has ( "gui_win32" ) || has ( "gui_gtk" )) && ! exists ( "b:browsefilter" ) 41let b: browsefilter = "Pascal Source Files (*.pas, *.pp, *.inc)\t*.pas;*.pp;*.inc\n" 42if has ( "win32" ) 43let b: browsefilter ..= "All Files (*.*)\t*\n" 44else 45let b: browsefilter ..= "All Files (*)\t*\n" 46endif 47endif 48 49let b: undo_ftplugin = "setl fo< cms< com< " .. 50 \"| unlet! b:browsefilter b:match_words b:match_ignorecase" 51 52let & cpo = s: cpo_save 53unlet s: cpo_save 54 55" vim: nowrap sw=2 sts=2 ts=8 noet: