Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim filetype plugin file |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 2 | " Language: Pascal |
| 3 | " Maintainer: Doug Kearns <dougkearns@gmail.com> |
Bram Moolenaar | 1588bc8 | 2022-03-08 21:35:07 +0000 | [diff] [blame] | 4 | " Previous Maintainer: Dan Sharp |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 5 | " Last Change: 2024 Jan 14 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 6 | |
| 7 | if exists("b:did_ftplugin") | finish | endif |
| 8 | let b:did_ftplugin = 1 |
| 9 | |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 10 | let s:cpo_save = &cpo |
| 11 | set cpo&vim |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 12 | |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 13 | set comments=s:(*,m:\ ,e:*),s:{,m:\ ,e:} |
| 14 | set commentstring={%s} |
| 15 | |
| 16 | if exists("pascal_delphi") |
| 17 | set comments+=:/// |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 18 | endif |
| 19 | |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 20 | if !exists("pascal_traditional") |
| 21 | set commentstring=//\ %s |
| 22 | set comments+=:// |
| 23 | endif |
| 24 | |
| 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") |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 40 | let b:browsefilter = "Pascal Source Files (*.pas, *.pp, *.inc)\t*.pas;*.pp;*.inc\n" |
| 41 | if has("win32") |
| 42 | let b:browsefilter ..= "All Files (*.*)\t*\n" |
| 43 | else |
| 44 | let b:browsefilter ..= "All Files (*)\t*\n" |
| 45 | endif |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 46 | endif |
| 47 | |
| 48 | let b:undo_ftplugin = "setl fo< cms< com< " .. |
| 49 | \ "| unlet! b:browsefilter b:match_words b:match_ignorecase" |
| 50 | |
| 51 | let &cpo = s:cpo_save |
| 52 | unlet s:cpo_save |
| 53 | |
| 54 | " vim: nowrap sw=2 sts=2 ts=8 noet: |