LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   VI:how do you change tab size? (http://www.linuxquestions.org/questions/programming-9/vi-how-do-you-change-tab-size-96885/)

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!
-gtang

ehdwuld 09-25-2003 06:11 PM

http://www.thomer.com/vi/vi.html
http://www.eng.hawaii.edu/Tutor/vi.html
http://www.bostic.com/vi/

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

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.

Lyle

gtanghookup 09-26-2003 06:23 PM

thanks Lyle, quite helpful


All times are GMT -5. The time now is 08:37 AM.