I'm guessing I'm not answering the real question, Yakov, for I recognize you as one of the frequent responders to this list and therefore someone who knows better than I. Nevertheless, I promised and answer here and someone else may be waiting on it even though it falls short of what you wanted. This particular trick has solved all my problems in juggling two separate tab formats at my workplace:

/* vim: tabstop=3:shiftwidth=3:noexpandtab
*/

This is what I put in the files I want entabbed at 3 with tabs instead of spaces, not the normal format of files for the rest of my development group.

Also, I found I had to put the statement across two lines like that or Vim wouldn't take it. I don't remember why, just that this is what I ended up with.

Hope this helped someone. I know that, a couple of months back when I started at this new company, it would have helped me.

Russ



Russell Bateman wrote:
Yakov,

I know how to do this, but the only example I have of it is at work and I won't be there until tomorrow.

It involves putting something like this at the top or bottom of the file:

/*
* vim set tabstop 4:shiftwidth 3:autoindent */

Anything you can specify using set in ex will get processed in place of what you have in your .vimrc/_vimrc file. I will give you exact details tomorrow because I'm certain this syntax isn't spot on as I've done it here. Since I entab all files at 3 at home, and only mix 3 and 4 at work, I realize I don't have an example to look at. I think there is help for this in Vim, but I don't remember the topic and I also found something peculiar about the number of lines for this thing.

Tomorrow,

Russ

Yakov Lerner wrote:

Some of the files I use are 8-tabbed, some are 4-tabbed.
These files are readonly, so modelines are not an option.
(I am talking about \t tabs, not about vim7 tabpages).

Viminfo remembers last position in the file. When I
reopen file, vim remembers last position.

Is there any way to tell vim to remember the last tabstop-related
options per file in the viminfo ?

Thanks
Yakov





Reply via email to