matlab.vim 835 B

1234567891011121314151617181920212223242526272829303132333435
  1. " Vim filetype plugin file
  2. " Language: matlab
  3. " Maintainer: Jake Wasserman <jwasserman at gmail dot com>
  4. " Update By: Gabriel Dupras
  5. " Last Change: 2021 Aug 30
  6. " Contributors:
  7. " Charles Campbell
  8. if exists("b:did_ftplugin")
  9. finish
  10. endif
  11. let b:did_ftplugin = 1
  12. let s:save_cpo = &cpo
  13. set cpo-=C
  14. if exists("loaded_matchit")
  15. let s:conditionalEnd = '\%(\%(^\|;\)\s*\)\@<=end\>'
  16. let b:match_words=
  17. \ '\<\%(if\|switch\|for\|while\|try\)\>:\<\%(elseif\|case\|break\|continue\|else\|otherwise\|catch\)\>:' . s:conditionalEnd . ',' .
  18. \ '\<function\>:\<return\>:\<endfunction\>'
  19. unlet s:conditionalEnd
  20. endif
  21. setlocal suffixesadd=.m
  22. setlocal suffixes+=.asv
  23. setlocal commentstring=%\ %s
  24. let b:undo_ftplugin = "setlocal suffixesadd< suffixes< commentstring< "
  25. \ . "| unlet! b:match_words"
  26. let &cpo = s:save_cpo
  27. unlet s:save_cpo