LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-29-2005, 10:31 PM   #1
manikantha
Member
 
Registered: Sep 2004
Location: Guntur,India
Distribution: FC3 - 64-Bit
Posts: 56

Rep: Reputation: 21
Using Visual in VIM editor


Hi,
I have so many codes like this ..

00053+
00054 #include <stdio.h>
00055 #include "iso8211.h"
00056 #include "cpl_vsi.h"
00057+
00058 CPL_CVSID("$Id: 8211dump.cpp,v 1.6 2003/11/11 20:53:53 warmerda Exp $");
00059+
00060+
00061 int main( int nArgc, char ** papszArgv )
00062+
00063 {
00064 DDFModule oModule;
00065 const char *pszFilename = NULL;
00066 int bFSPTHack = FALSE;
00067+
00068 /* -------------------------------------------------------------------- */
00069 /* Check arguments. */
00070 /* -------------------------------------------------------------------- */
00071 for( int iArg = 1; iArg < nArgc; iArg++ )
00072 {
00073 if( EQUAL(papszArgv[iArg],"-fspt_repeating") )
00074 bFSPTHack = TRUE;
00075 else
00076 pszFilename = papszArgv[iArg];
00077 }
00078+
00079 if( pszFilename == NULL )
00080 {
00081 printf( "Usage: 8211dump filename\n" );
00082 exit( 1 );
00083 }
00084+

of which I want to remove the numbers at the starting using Visual.. Can any one tell me how to do this in VIM editor .
Thanks in Advance..
 
Old 05-29-2005, 11:20 PM   #2
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
select all the lines, then type...
:s#^......##
 
Old 05-29-2005, 11:49 PM   #3
manikantha
Member
 
Registered: Sep 2004
Location: Guntur,India
Distribution: FC3 - 64-Bit
Posts: 56

Original Poster
Rep: Reputation: 21
Thank you niknah for replying me...
But after selecting the numbers how to remove them??
 
Old 05-30-2005, 02:15 AM   #4
niknah
Member
 
Registered: Dec 2002
Location: In front of a computer
Distribution: UPS, DHL, FedEx
Posts: 466

Rep: Reputation: 38
I'm not sure what you mean by "visual in vim", do you mean easy mode? Not really sure how to type in commands in easy mode, someone else might know.

in normal vim, type this to remove them...
:s#^......##

...and press enter.

":" should get you into the command at the bottom, and the rest should remove 6 characters from the start of every line you've selected.
 
Old 06-10-2005, 08:55 AM   #5
manikantha
Member
 
Registered: Sep 2004
Location: Guntur,India
Distribution: FC3 - 64-Bit
Posts: 56

Original Poster
Rep: Reputation: 21
Ya!! now I got how to do .. We have to use Ctrl+v in Esc mode..and can select how much u want..
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VIM insert before a visual block... pld Linux - Software 0 06-22-2005 11:36 AM
Possible problem with VISUAL=vi (vim & bash) redthor Linux - Newbie 2 04-26-2005 06:19 AM
replace a word in vim editor fssengg Linux - Newbie 3 03-10-2005 08:39 AM
eclipse visual editor csfalcon Programming 1 02-11-2005 11:10 AM
Configuration for VIM editor ICO Linux - General 5 08-02-2003 08:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration