postscr.vim (1280B)
1 " Vim filetype plugin file 2 " Language: PostScript 3 " Maintainer: Mike Williams <mrw@eandem.co.uk> 4 " Last Change: 24th April 2012 5 " 2024 Jan 14 by Vim Project (browsefilter) 6 " 2025 Jun 08 by Riley Bruins <ribru17@gmail.com> ('commentstring') 7 8 " Only do this when not done yet for this buffer 9 if exists("b:did_ftplugin") 10 finish 11 endif 12 13 " Don't load another plugin for this buffer 14 let b:did_ftplugin = 1 15 16 let s:cpo_save = &cpo 17 set cpo&vim 18 19 " PS comment formatting 20 setlocal comments=b:% 21 setlocal commentstring=%\ %s 22 setlocal formatoptions-=t formatoptions+=rol 23 24 " Define patterns for the matchit macro 25 if !exists("b:match_words") 26 let b:match_ignorecase = 0 27 let b:match_words = '<<:>>,\<begin\>:\<end\>,\<save\>:\<restore\>,\<gsave\>:\<grestore\>' 28 endif 29 30 " Define patterns for the browse file filter 31 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") 32 let b:browsefilter = "PostScript Files (*.ps)\t*.ps\n" . 33 \ "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 39 endif 40 41 let b:undo_ftplugin = "setlocal comments< commentstring< formatoptions<" 42 \ . "| unlet! b:browsefilter b:match_ignorecase b:match_words" 43 44 let &cpo = s:cpo_save 45 unlet s:cpo_save