Skip to content

Commit 1f90f5e

Browse files
committed
Move tab settings to ftplugin. Closes derekwyatt#49
Agreed that these are not usually in the indent files, typically overridden in `after/ftplugin` or `autocmd FileType`, so this makes that possible. 'tabstop' is best left alone when the others are set along with 'expandtab'. References derekwyatt#60.
1 parent 0f49942 commit 1f90f5e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ftplugin/scala.vim

+7-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,19 @@ if exists('b:did_ftplugin') || &cp
1010
endif
1111
let b:did_ftplugin = 1
1212

13-
setlocal formatoptions+=ro
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
1416

1517
" Just like c.vim, but additionally doesn't wrap text onto /** line when
1618
" formatting. Doesn't bungle bulleted lists when formatting.
1719
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
1820
setlocal commentstring=//\ %s
1921

20-
let &l:include = '^\s*import'
21-
let &l:includeexpr = 'substitute(v:fname,"\\.","/","g")'
22+
setlocal shiftwidth=2 softtabstop=2 expandtab
23+
24+
setlocal include='^\s*import'
25+
setlocal includeexpr='substitute(v:fname,"\\.","/","g")'
2226

2327
setlocal path+=src/main/scala,src/test/scala
2428
setlocal suffixesadd=.scala

indent/scala.vim

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ if exists("b:did_indent")
99
endif
1010
let b:did_indent = 1
1111

12+
setlocal autoindent
1213
setlocal indentexpr=GetScalaIndent()
1314
setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case,<CR>
14-
setlocal autoindent
15-
setlocal softtabstop=2
16-
setlocal tabstop=2
17-
setlocal shiftwidth=2
18-
setlocal expandtab
1915

2016
if exists("*GetScalaIndent")
2117
finish

0 commit comments

Comments
 (0)