postscr.vim 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. " Only do this when not done yet for this buffer
  7. if exists("b:did_ftplugin")
  8. finish
  9. endif
  10. " Don't load another plugin for this buffer
  11. let b:did_ftplugin = 1
  12. let s:cpo_save = &cpo
  13. set cpo&vim
  14. " PS comment formatting
  15. setlocal comments=b:%
  16. setlocal formatoptions-=t formatoptions+=rol
  17. " Define patterns for the matchit macro
  18. if !exists("b:match_words")
  19. let b:match_ignorecase = 0
  20. let b:match_words = '<<:>>,\<begin\>:\<end\>,\<save\>:\<restore\>,\<gsave\>:\<grestore\>'
  21. endif
  22. " Define patterns for the browse file filter
  23. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  24. let b:browsefilter = "PostScript Files (*.ps)\t*.ps\n" .
  25. \ "EPS Files (*.eps)\t*.eps\n"
  26. if has("win32")
  27. let b:browsefilter .= "All Files (*.*)\t*\n"
  28. else
  29. let b:browsefilter .= "All Files (*)\t*\n"
  30. endif
  31. endif
  32. let b:undo_ftplugin = "setlocal comments< formatoptions<"
  33. \ . "| unlet! b:browsefilter b:match_ignorecase b:match_words"
  34. let &cpo = s:cpo_save
  35. unlet s:cpo_save