Vim convert tabs to spaces for one folder

1

I'm working on a project with a friend soon. Given that he cares about these things more than me, I let him choose the indentation. Him being a Ruby fan, he chose two spaces.

My usual is to use tabs. Is there anyway I can set vim to, only in this specific folder, have it as two spaces when I press the tab button?

Macha

Posted 2010-02-13T22:04:18.543

Reputation: 4 772

Double spaces? Now I really have heard everything! – Phoshi – 2010-02-13T22:07:34.913

I thought the meaning was clear. Double spaces = two spaces. Edited anyway... – Macha – 2010-02-13T22:08:16.083

Oh, no, I understood what you meant, I just didn't think anybody seriously used those over tabs :P – Phoshi – 2010-02-13T22:15:16.987

@Phoshi: I know. I like tabs, because at the end of the day you can change your editor settings if you are not happy with how wide they are. You can't do that with spaces (any amount) – Macha – 2010-02-13T22:16:20.307

Sure you can ... vim ... retab ... – Rook – 2010-02-13T23:43:59.317

Answers

3

Weeks ago, I was facing the same problem and I found this : Secrets of tabs in vim

As I did for scala, it's easy to adapt this for ruby

vim will also read .vimrc in the current directory (when the exrc option is set in your normal vimrc), which is useful when editing large numbers of source files in the same directory, or to avoid corrupting source files you don't control.

Kami

Posted 2010-02-13T22:04:18.543

Reputation: 3 108

-1

Use the "set tabstop=2" option

Anonymous

Posted 2010-02-13T22:04:18.543

Reputation: 1

2The question was for only one directory. That would change it globally. – Macha – 2010-05-02T11:35:05.383