-   Programming (
-   -   VI:how do you change tab size? (

gtanghookup 09-25-2003 06:02 PM

VI:how do you change tab size?
Hello, I have been looking around in the man pages and in several configuration files about how to change tab width in VI, right now, a tab is worth about 8 spaces and for a programming class that I'm taking the # of tabs must be 4 or the instructor sends the assignment back. Thanks in advance!

ehdwuld 09-25-2003 06:11 PM

just google vi

lots of tutorials on it

lyle_s 09-25-2003 08:25 PM

:set tabstop=4

You'll probably also want

:set shiftwidth=4


lyle_s 09-26-2003 12:35 AM

I just realized my answer wasn't that good.

It doesn't matter what your tabstop is set to in vi to people you send a file to--they see tabs as their editor chooses to interpret them. A tab character is a tab character is a tab character; it's up to the text editor to decide how many spaces they should look like on the screen.

Perhaps you should run your source files through and "expand" command. See man expand.


gtanghookup 09-26-2003 06:23 PM

thanks Lyle, quite helpful

All times are GMT -5. The time now is 02:05 PM.