tags:

views:

206

answers:

2

I would like tabs in my source code to remain tabs (8 spaces wide), NOT to be converted to spaces, but displayed as 2 spaces.

I recall vim being able to accomplish this.

Could anyone help me a little?

+1  A: 

"remain 8 spaces wide but display as 2 spaces" doesn't make any sense to me. Tabs don't inherently have any spacing information (8 or otherwise), it's completely up to interpretation of each program working with the data.

For 2-space tabs and no use of spaces:

se noet ts=2 sts=2 sw=2

For 8-space tabs, 2-space indents, and minimal use of spaces:

se noet ts=8 sts=2 sw=2
ephemient
Yeah, I do realize. I was trying to say that I want ^T characters to be written to the file (which are usually rendered as 8 spaces wide). I apologize.
Danny
Tab characters are actually `^I`.
ephemient
+2  A: 

You want:

tabstop=2
shiftwidth=2
noexpandtab

That will put 0x9 tab chars in the file and treat them as 2 spaces when displaying.

Ry4an
That did it, thanks a lot!I do realize it's quite a basic question, but I've only just switched from nvi and I got kind of confused with all the tab options.
Danny