LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 12:37 PM   #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, 01:04 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
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


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

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

All times are GMT -5. The time now is 06:09 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration