LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-22-2011, 11:37 AM   #1
e3399
Member
 
Registered: Nov 2010
Location: China
Distribution: Fedora12
Posts: 54

Rep: Reputation: 0
vim:how to change code style.


if(flag)
{
a = 1;
}
if(flag)
{

}
I want to change the code style the way below:

if(flag){
a = 1;
}
How can I do this with the help of powerful vim.
Any help will be appreciated.
 
Old 03-22-2011, 12:04 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Which "code" are you talking about? Could this be perl?

Here's one that does perl: perltidy and A Brief Perltidy Tutorial

BTW: This is not a native vim solution, but as explained in the brief tutorial, it can be used from within vim.

Hope this helps.
 
  


Reply



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
Is there any tool of which can format my C code to a certain coding style ? phyyu Linux - Newbie 1 07-21-2010 06:47 AM
kde style change? lilili Linux - Newbie 3 01-07-2006 12:33 AM
VIM-style wrapping to OpenOffice style schmmd Linux - Software 1 12-21-2004 06:50 PM
how to change mandrake style menu to kde style menu msalimane Mandriva 1 12-07-2004 01:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:01 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration