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