modula2.vim 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. " Vim filetype plugin file
  2. " Language: Modula-2
  3. " Maintainer: Doug Kearns <dougkearns@gmail.com>
  4. " Last Change: 2021 Apr 08
  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. if exists("loaded_matchit") && !exists("b:match_words")
  15. " The second branch of the middle pattern is intended to match CASE labels
  16. let b:match_words = '\<REPEAT\>:\<UNTIL\>,' ..
  17. \ '\<\%(BEGIN\|CASE\|FOR\|IF\|LOOP\|WHILE\|WITH\)\>' ..
  18. \ ':' ..
  19. \ '\<\%(ELSIF\|ELSE\)\>\|\%(^\s*\)\@<=\w\+\%(\s*\,\s*\w\+\)\=\s*\:=\@!' ..
  20. \ ':' ..
  21. \ '\<END\>'
  22. endif
  23. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  24. let b:browsefilter = "Modula-2 Source Files (*.def *.mod)\t*.def;*.mod\n" ..
  25. \ "All Files (*.*)\t*.*\n"
  26. endif
  27. let b:undo_ftplugin = "setl com< cms< fo< " ..
  28. \ "| unlet! b:browsefilter b:match_words"
  29. let &cpo = s:cpo_save
  30. unlet s:cpo_save
  31. " vim: nowrap sw=2 sts=2 ts=8 noet: