scala.vim 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. " Vim filetype plugin file
  2. " Language: Scala
  3. " Maintainer: Derek Wyatt
  4. " URL: https://github.com/derekwyatt/vim-scala
  5. " License: Same as Vim
  6. " Last Change: 11 August 2021
  7. " 2023 Aug 28 by Vim Project (undo_ftplugin)
  8. " ----------------------------------------------------------------------------
  9. if exists('b:did_ftplugin') || &cp
  10. finish
  11. endif
  12. let b:did_ftplugin = 1
  13. " j is fairly new in Vim, so don't complain if it's not there
  14. setlocal formatoptions-=t formatoptions+=croqnl
  15. silent! setlocal formatoptions+=j
  16. " Just like c.vim, but additionally doesn't wrap text onto /** line when
  17. " formatting. Doesn't bungle bulleted lists when formatting.
  18. if get(g:, 'scala_scaladoc_indent', 0)
  19. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s2:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
  20. else
  21. setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
  22. endif
  23. setlocal commentstring=//\ %s
  24. setlocal shiftwidth=2 softtabstop=2 expandtab
  25. setlocal include=^\\s*import
  26. setlocal includeexpr=substitute(v:fname,'\\.','/','g')
  27. setlocal path+=src/main/scala,src/test/scala
  28. setlocal suffixesadd=.scala
  29. let b:undo_ftplugin = "setlocal cms< com< et< fo< inc< inex< pa< sts< sua< sw<"
  30. " vim:set sw=2 sts=2 ts=8 et: