LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-25-2003, 05:02 PM   #1
gtanghookup
LQ Newbie
 
Registered: Sep 2003
Location: Portland, Oregon
Distribution: Debian and Gentoo
Posts: 27

Rep: Reputation: 15
Question 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
 
Old 09-25-2003, 05:11 PM   #2
ehdwuld
Member
 
Registered: Jul 2003
Distribution: Currently Suse 11.1 but have RH7,8,9 / Fedora 7,8_64,9_64,&10_64
Posts: 634

Rep: Reputation: 30
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
 
Old 09-25-2003, 07:25 PM   #3
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 388

Rep: Reputation: 52
:set tabstop=4

You'll probably also want

:set shiftwidth=4

Lyle
 
Old 09-25-2003, 11:35 PM   #4
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 388

Rep: Reputation: 52
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
 
Old 09-26-2003, 05:23 PM   #5
gtanghookup
LQ Newbie
 
Registered: Sep 2003
Location: Portland, Oregon
Distribution: Debian and Gentoo
Posts: 27

Original Poster
Rep: Reputation: 15
thanks Lyle, quite helpful
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to force Focus Change (Alt+Tab) in Games? Stroganoff Linux - Software 6 11-25-2005 11:50 AM
How to change default TAB lenth ??? dileepkk Linux - Software 3 09-29-2005 01:22 AM
Firefox, change tab order by dragging tabs with mouse: how? loonyxp Linux - Software 5 08-10-2005 08:29 AM
tab in Konsole shows size true_atlantis Linux - Software 5 02-19-2004 11:29 PM
Change size of icons on Alt+tab for KDE via RH9 robertmarkbram Linux - Software 0 10-13-2003 08:48 PM


All times are GMT -5. The time now is 04:24 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration