occam.vim 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. " Vim filetype plugin file
  2. " Language: occam
  3. " Copyright: Christian Jacobsen <clj3@kent.ac.uk>, Mario Schweigler <ms44@kent.ac.uk>
  4. " Maintainer: Mario Schweigler <ms44@kent.ac.uk>
  5. " Last Change: 23 April 2003
  6. " 2024 Jan 14 by Vim Project (browsefilter)
  7. " Only do this when not done yet for this buffer
  8. if exists("b:did_ftplugin")
  9. finish
  10. endif
  11. let b:did_ftplugin = 1
  12. let s:keepcpo= &cpo
  13. set cpo&vim
  14. "{{{ Indent settings
  15. " Set shift width for indent
  16. setlocal shiftwidth=2
  17. " Set the tab key size to two spaces
  18. setlocal softtabstop=2
  19. " Let tab keys always be expanded to spaces
  20. setlocal expandtab
  21. "}}}
  22. "{{{ Formatting
  23. " Break comment lines and insert comment leader in this case
  24. setlocal formatoptions-=t formatoptions+=cql
  25. setlocal comments+=:--
  26. " Maximum length of comments is 78
  27. setlocal textwidth=78
  28. "}}}
  29. "{{{ File browsing filters
  30. " Win32 and GTK can filter files in the browse dialog
  31. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  32. let b:browsefilter = "All Occam Files (*.occ, *.inc)\t*.occ;*.inc\n" .
  33. \ "Occam Include Files (*.inc)\t*.inc\n" .
  34. \ "Occam Source Files (*.occ)\t*.occ\n"
  35. if has("win32")
  36. let b:browsefilter .= "All Files (*.*)\t*\n"
  37. else
  38. let b:browsefilter .= "All Files (*)\t*\n"
  39. endif
  40. endif
  41. "}}}
  42. "{{{ Undo settings
  43. let b:undo_ftplugin = "setlocal shiftwidth< softtabstop< expandtab<"
  44. \ . " formatoptions< comments< textwidth<"
  45. \ . "| unlet! b:browsefilter"
  46. "}}}
  47. let &cpo = s:keepcpo
  48. unlet s:keepcpo