The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Indent Finder 1.31 (Default branch) iBot Software Releases - RSS News 0 09-07-2008 09:30 PM
Indent Finder 1.3 (Default branch) iBot Software Releases - RSS News 0 07-20-2008 10:50 PM
[non-important] Indent here-docs? yongho UNIX for Dummies Questions & Answers 4 06-21-2005 11:51 AM
vim indent Virtuosso UNIX for Dummies Questions & Answers 4 02-06-2003 05:15 PM
Auto indent in vi sierra_aar UNIX for Dummies Questions & Answers 1 06-19-2002 11:36 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 4.00 average. Display Modes
  #1 (permalink)  
Old 10-29-2008
SaTYR SaTYR is offline
Registered User
  
 

Join Date: May 2005
Posts: 25
vi auto indent whole file at once

Hi,

I'm working on a big project and all the CPP and header files are in mess with respect to indentation. I would like to indent whole file(s) at once (like ctrl-shift-f in eclipse). Is there anybody who knows how to do that in vi/vim?

thanks

Last edited by SaTYR; 10-30-2008 at 08:26 PM..
  #2 (permalink)  
Old 10-30-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
In vim, the = command formats C code. Try going to the first line and hitting =G.

You may also want to :set cindent to get some automatic formatting happening while you edit code. And possibly :set sw=4 if you only want to indent by 4 characters, etc.
  #3 (permalink)  
Old 11-01-2008
SaTYR SaTYR is offline
Registered User
  
 

Join Date: May 2005
Posts: 25
Thanks Annihilannic!!

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0