modula3.vim 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. " Vim filetype plugin file
  2. " Language: Modula-3
  3. " Maintainer: Doug Kearns <dougkearns@gmail.com>
  4. " Last Change: 2022 June 12
  5. if exists("b:did_ftplugin")
  6. finish
  7. endif
  8. let b:did_ftplugin = 1
  9. let s:cpo_save = &cpo
  10. set cpo&vim
  11. setlocal comments=s0:(*,mb:\ ,ex:*)
  12. setlocal commentstring=(*%s*)
  13. setlocal formatoptions-=t formatoptions+=croql
  14. setlocal suffixesadd+=.m3
  15. setlocal formatprg=m3pp
  16. let b:undo_ftplugin = "setlocal com< cms< fo< fp< sua<"
  17. if exists("loaded_matchit") && !exists("b:match_words")
  18. let b:match_words = '\<REPEAT\>:\<UNTIL\>,' ..
  19. \ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOCK\|LOOP\|TRY\|TYPECASE\|WHILE\|WITH\|RECORD\|OBJECT\)\>' ..
  20. \ ':' ..
  21. \ '\<\%(ELSIF\|ELSE\|EXCEPT\|FINALLY\|METHODS\|OVERRIDES\)\>\|\%(^\s*\)\@<=\S.*=>' ..
  22. \ ':' ..
  23. \ '\<END\>,' ..
  24. \ '(\*:\*),<\*:\*>'
  25. let b:undo_ftplugin ..= " | unlet! b:match_words"
  26. endif
  27. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  28. let b:browsefilter = "Modula-3 Source Files (*.m3)\t*.m3\n" ..
  29. \ "All Files (*.*)\t*.*\n"
  30. let b:undo_ftplugin ..= " | unlet! b:browsefilter"
  31. endif
  32. let &cpo = s:cpo_save
  33. unlet s:cpo_save
  34. " vim: nowrap sw=2 sts=2 ts=8 noet: