blob: eb53b38f09d6d51c3622ddbc84bd6b2c6831c37b [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim filetype plugin file
Bram Moolenaar6be7f872012-01-20 21:08:56 +01002" Language: PostScript
3" Maintainer: Mike Williams <mrw@eandem.co.uk>
Doug Kearns93197fd2024-01-14 20:59:02 +01004" Last Change: 24th April 2012
5" 2024 Jan 14 by Vim Project (browsefilter)
Riley Bruins9e9fe662025-06-09 21:08:33 +02006" 2025 Jun 08 by Riley Bruins <ribru17@gmail.com> ('commentstring')
Bram Moolenaar071d4272004-06-13 20:20:40 +00007
8" Only do this when not done yet for this buffer
9if exists("b:did_ftplugin")
10 finish
11endif
12
13" Don't load another plugin for this buffer
14let b:did_ftplugin = 1
15
Bram Moolenaar6be7f872012-01-20 21:08:56 +010016let s:cpo_save = &cpo
17set cpo&vim
18
Bram Moolenaar071d4272004-06-13 20:20:40 +000019" PS comment formatting
20setlocal comments=b:%
Riley Bruins9e9fe662025-06-09 21:08:33 +020021setlocal commentstring=%\ %s
Bram Moolenaar071d4272004-06-13 20:20:40 +000022setlocal formatoptions-=t formatoptions+=rol
23
24" Define patterns for the matchit macro
25if !exists("b:match_words")
26 let b:match_ignorecase = 0
27 let b:match_words = '<<:>>,\<begin\>:\<end\>,\<save\>:\<restore\>,\<gsave\>:\<grestore\>'
28endif
29
Bram Moolenaar071d4272004-06-13 20:20:40 +000030" Define patterns for the browse file filter
Doug Kearns93197fd2024-01-14 20:59:02 +010031if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
Bram Moolenaar071d4272004-06-13 20:20:40 +000032 let b:browsefilter = "PostScript Files (*.ps)\t*.ps\n" .
Doug Kearns93197fd2024-01-14 20:59:02 +010033 \ "EPS Files (*.eps)\t*.eps\n"
34 if has("win32")
35 let b:browsefilter .= "All Files (*.*)\t*\n"
36 else
37 let b:browsefilter .= "All Files (*)\t*\n"
38 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000039endif
Bram Moolenaar6be7f872012-01-20 21:08:56 +010040
Riley Bruins9e9fe662025-06-09 21:08:33 +020041let b:undo_ftplugin = "setlocal comments< commentstring< formatoptions<"
Doug Kearns93197fd2024-01-14 20:59:02 +010042 \ . "| unlet! b:browsefilter b:match_ignorecase b:match_words"
Bram Moolenaarddbb5552012-04-26 20:17:03 +020043
44let &cpo = s:cpo_save
45unlet s:cpo_save