Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
Double spaces? Now I really have heard everything! –  Phoshi Feb 13 '10 at 22:07
    
I thought the meaning was clear. Double spaces = two spaces. Edited anyway... –  Macha Feb 13 '10 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 '10 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 '10 at 22:16
    
Sure you can ... vim ... retab ... –  ldigas Feb 13 '10 at 23:43
add comment

2 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

Use the "set tabstop=2" option

share|improve this answer
1  
The question was for only one directory. That would change it globally. –  Macha May 2 '10 at 11:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.