7
|
1 " Vim filetype plugin file
|
24569
|
2 " Language: Pascal
|
|
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
|
|
4 " Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
|
5 " Last Change: 2021 Apr 23
|
7
|
6
|
|
7 if exists("b:did_ftplugin") | finish | endif
|
|
8 let b:did_ftplugin = 1
|
|
9
|
24569
|
10 let s:cpo_save = &cpo
|
|
11 set cpo&vim
|
|
12
|
|
13 set comments=s:(*,m:\ ,e:*),s:{,m:\ ,e:}
|
|
14 set commentstring={%s}
|
2788
|
15
|
24569
|
16 if exists("pascal_delphi")
|
|
17 set comments+=:///
|
|
18 endif
|
|
19
|
|
20 if !exists("pascal_traditional")
|
|
21 set commentstring=//\ %s
|
|
22 set comments+=://
|
7
|
23 endif
|
|
24
|
24569
|
25 setlocal formatoptions-=t formatoptions+=croql
|
|
26
|
|
27 if 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\.'
|
|
37 endif
|
|
38
|
|
39 if (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"
|
|
42 endif
|
|
43
|
|
44 let b:undo_ftplugin = "setl fo< cms< com< " ..
|
|
45 \ "| unlet! b:browsefilter b:match_words b:match_ignorecase"
|
|
46
|
|
47 let &cpo = s:cpo_save
|
|
48 unlet s:cpo_save
|
|
49
|
|
50 " vim: nowrap sw=2 sts=2 ts=8 noet:
|