adelbertc
adelbertc

Reputation: 7320

Change number of spaces for soft tabs in vim depending on extension

So I started learning Scala today and I got all my vim config files working for Scala syntax highlighting and such, but the files I downloaded (http://lorenzod8n.wordpress.com/2008/01/11/getting-scala-syntax-hightlighting-to-work-in-vim/) did not seem to include the apparent Scala convention of indent by 2 spaces.

Since for my job I mostly work in C++ and Python, I currently have my set tabstop=4.

I've been trying to figure out how to use the if/endif statements for .vimrc files to do set tabstop=2 if the extension if *.scala, otherwise use tabstop=4 but not having much luck.. help?

Thanks!

-kshot

Upvotes: 0

Views: 534

Answers (1)

kev
kev

Reputation: 161934

set tabstop=4
au BufNewFile,BufRead *.scala set tabstop=2

Upvotes: 4

Related Questions