scala.vim (1473B)
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 " 2026 Jun 27 by Vim Project (add recommended style guard) 9 " ---------------------------------------------------------------------------- 10 11 if exists('b:did_ftplugin') || &cp 12 finish 13 endif 14 let b:did_ftplugin = 1 15 16 " j is fairly new in Vim, so don't complain if it's not there 17 setlocal formatoptions-=t formatoptions+=croqnl 18 silent! setlocal formatoptions+=j 19 20 " Just like c.vim, but additionally doesn't wrap text onto /** line when 21 " formatting. Doesn't bungle bulleted lists when formatting. 22 if get(g:, 'scala_scaladoc_indent', 0) 23 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s2:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,:// 24 else 25 setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,:// 26 endif 27 setlocal commentstring=//\ %s 28 29 if get(g:, 'scala_recommended_style', 30 \ get(g:, 'filetype_recommended_style', 1)) 31 setlocal shiftwidth=2 softtabstop=2 expandtab 32 endif 33 34 setlocal include=^\\s*import 35 setlocal includeexpr=substitute(v:fname,'\\.','/','g') 36 37 setlocal path+=src/main/scala,src/test/scala 38 setlocal suffixesadd=.scala 39 40 let b:undo_ftplugin = "setlocal cms< com< et< fo< inc< inex< pa< sts< sua< sw<" 41 42 " vim:set sw=2 sts=2 ts=8 et: