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?

5
  • Double spaces? Now I really have heard everything!
    – Phoshi
    Feb 13, 2010 at 22:07
  • I thought the meaning was clear. Double spaces = two spaces. Edited anyway...
    – Macha
    Feb 13, 2010 at 22:08
  • Oh, no, I understood what you meant, I just didn't think anybody seriously used those over tabs :P
    – Phoshi
    Feb 13, 2010 at 22:15
  • @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
    Feb 13, 2010 at 22:16
  • Sure you can ... vim ... retab ...
    – Rook
    Feb 13, 2010 at 23:43

2 Answers 2

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.

-1

Use the "set tabstop=2" option

1
  • 2
    The question was for only one directory. That would change it globally.
    – Macha
    May 2, 2010 at 11:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .