Fedora Linux Support Community & Resources Center
  #1  
Old 18th June 2007, 04:04 AM
youhaodeyi Offline
Registered User
 
Join Date: May 2007
Posts: 217
How to use indent to make this style?

My code is

if( a == 1){
return 0;
}else{
return -1;
}

I want to use indent to make it to:

if( a == 1 )
{
return 0;
}else
{
return -1;
}

How can I do that?
thanks.
Reply With Quote
  #2  
Old 18th June 2007, 04:49 AM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,302
indent -prs -nsai -bl -bli0 -ce -i0
is pretty close, but it doesn't eliminate the "} else" space.

My question is ... why do you want that sort of 'style'. It's completely unreadable - horrible !
Reply With Quote
  #3  
Old 18th June 2007, 04:52 AM
youhaodeyi Offline
Registered User
 
Join Date: May 2007
Posts: 217
There should be some space before each line in if block. But I don't know why these spaces disappeared after i post the reply.
Reply With Quote
  #4  
Old 18th June 2007, 11:22 AM
clearer's Avatar
clearer Offline
Registered User
 
Join Date: Sep 2004
Location: Odense, Denmark
Age: 31
Posts: 580
try encasing your code examples in code tags. Makes formatting easier.
__________________
Why you shouldn't use RAID3/4/5
The thoughts of a madman
==========================
I am not a lawyer.
Reply With Quote
  #5  
Old 19th June 2007, 01:47 AM
youhaodeyi Offline
Registered User
 
Join Date: May 2007
Posts: 217
How can I encase my code in code tags?
Reply With Quote
Reply

Tags
indent, make, style

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can indent change a xml style? youhaodeyi Programming & Packaging 4 16th June 2007 03:03 PM
Why kate/kwrite's auto indent doesn't work? Starwalker Using Fedora 0 8th March 2006 11:45 AM
How do I set Tab key to be 3-char indent instead of 6-char indent? TheProgrammer Using Fedora 3 17th September 2005 08:55 AM


Current GMT-time: 18:38 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat