modula3.vim 1.4 KB

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