LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Using Visual in VIM editor (https://www.linuxquestions.org/questions/linux-general-1/using-visual-in-vim-editor-328404/)

manikantha 05-29-2005 10:31 PM

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..

niknah 05-29-2005 11:20 PM

select all the lines, then type...
:s#^......##

manikantha 05-29-2005 11:49 PM

Thank you niknah for replying me...
But after selecting the numbers how to remove them??

niknah 05-30-2005 02:15 AM

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.

manikantha 06-10-2005 08:55 AM

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


All times are GMT -5. The time now is 10:29 AM.