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 |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 6 | " 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7 | |
| 8 | if exists("b:did_ftplugin") | finish | endif |
| 9 | let b:did_ftplugin = 1 |
| 10 | |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 11 | let s:cpo_save = &cpo |
| 12 | set cpo&vim |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 13 | |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 14 | set comments=s:(*,m:\ ,e:*),s:{,m:\ ,e:} |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 15 | set commentstring={\ %s\ } |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 16 | |
| 17 | if exists("pascal_delphi") |
| 18 | set comments+=:/// |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 19 | endif |
| 20 | |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 21 | if !exists("pascal_traditional") |
| 22 | set commentstring=//\ %s |
| 23 | set comments+=:// |
| 24 | endif |
| 25 | |
| 26 | setlocal formatoptions-=t formatoptions+=croql |
| 27 | |
| 28 | if exists("loaded_matchit") |
| 29 | let b:match_ignorecase = 1 " (Pascal is case-insensitive) |
| 30 | |
| 31 | let b:match_words = '\<\%(asm\|begin\|case\|\%(\%(=\|packed\)\s*\)\@<=\%(class\|object\)\|\%(=\s*\)\@<=interface\|record\|try\)\>' |
| 32 | let b:match_words .= ':\%(^\s*\)\@<=\%(except\|finally\|else\|otherwise\)\>' |
| 33 | let b:match_words .= ':\<end\>\.\@!' |
| 34 | |
| 35 | let 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. |
| 37 | let b:match_words .= ',\<unit\>:\<\%(\%(^\s*\)\@<=interface\|implementation\|initialization\|finalization\)\>:\<end\.' |
| 38 | endif |
| 39 | |
| 40 | if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 41 | let b:browsefilter = "Pascal Source Files (*.pas, *.pp, *.inc)\t*.pas;*.pp;*.inc\n" |
| 42 | if has("win32") |
| 43 | let b:browsefilter ..= "All Files (*.*)\t*\n" |
| 44 | else |
| 45 | let b:browsefilter ..= "All Files (*)\t*\n" |
| 46 | endif |
Bram Moolenaar | 4c29502 | 2021-05-02 17:19:11 +0200 | [diff] [blame] | 47 | endif |
| 48 | |
| 49 | let b:undo_ftplugin = "setl fo< cms< com< " .. |
| 50 | \ "| unlet! b:browsefilter b:match_words b:match_ignorecase" |
| 51 | |
| 52 | let &cpo = s:cpo_save |
| 53 | unlet s:cpo_save |
| 54 | |
| 55 | " vim: nowrap sw=2 sts=2 ts=8 noet: |