*usr_12.txt*	 Vim version 6.2.   : 2002 Jul 22

		  VIM -  

			       


     Vim     ӣ,
 .         ,
 ,     ,  
 .

|12.1|	 
|12.2|	 ", "  " "
|12.3|	 
|12.4|	  
|12.5|	ޣ 
|12.6|	   man
|12.7|	  
|12.8|	 ,   

  : |usr_20.txt|      
 : |usr_11.txt|    
      : |usr_toc.txt|

==============================================================================
*12.1*	 

 substitute         
  : >

	:%s//3/g

 "%"    .  "g"     
   .
   ,        "",    
, , "3".    ,   .  
,   "\<"  ,    :
>
	%s/\</3/g

  ,    ,    "".
     ,   "\<": >

	%s/\<\>/3/g

   , , ,   ""  
.       ,  
"c",   substitute     : >

	:%s/\<four\>/4/gc


   

,        .   
       . , 
     ţ  .
              C++,
    ".cpp".     
"GetResp",       "GetAnswer".

	vim *.cpp		 Vim   , 
				      C++.   
				    .
	qq			     q.
	:%s/\<GetResp\>/GetAnswer/g
				     .
	:wnext			      . 
	q			 .
	@q			    q,  
				        
				     ":wnext". , 
				       .
	999@q			    q  
				   .

       ,  ":wnext"  
   .  ,   ,  
   . 

	:
	     
	  .  ,    
	   .

   :      .cpp   "GetResp",  
        . 
 ,      "e" >

	:%s/\<GetResp\>/GetAnswer/ge

 "e"  ":substitute",     
 .

==============================================================================
*12.2*	 ", "  " "

    ͣ   :

	,  ~
	,  ~

 ,    :

	  ~
	  ~

     - : >

	:%s/\([^,]*\), \(.*\)/\2 \1/

 ң.  ,    substitute.  "%"
     . 
     substitute    "///". 
   ""   "".    
"":
   
							  \([^,]*\), \(.*\) ~

	   \( \)  ""  \(     \)
	      ,       [^,]
	                           *
	  ","                         ,
	   \( \)  ""		     \(  \)
	       		               .
	        			        *

  ""    "\2"  "\1".    . 
  ,    "\( \)"  . "\2"
     "\( \)", ..  "". "\1"
    ޣ "\( \)", ..  "".
            "" 
substitute. "\0"     .   substitute
     , .
|__|.

==============================================================================
*12.3*	 

 Makefile    . :

	OBJS = \ ~
		version.o \ ~
		pch.o \ ~
		getopt.o \ ~
		util.o \ ~
		getopt1.o \ ~
		inp.o \ ~
		patch.o \ ~
		backup.o ~

   ,     -
sort: >

	/^OBJS
	j
	:.,/^$/-1!sort

Vim    ,     "OBJS", 
           
   .        
    "!sort".   ,   
 ,    .
     -:

	OBJS = \ ~
		backup.o ~
		getopt.o \ ~
		getopt1.o \ ~
		inp.o \ ~
		patch.o \ ~
		pch.o \ ~
		util.o \ ~
		version.o \ ~


 ,         
 .      
!  "backup.o",     ,   
   ,  ,      
,  ţ .
            
"A \<Esc>".       ,    ,
  ţ   .   ,   ,
   .

==============================================================================
*12.4*	  

 |:global|     |:move|    
      ,     
 .   : >

	:global/^/m 0

ݣ: >

	:g/^/m 0

  "^"   ,    , 
 .  |:move|     
   , ,     
  .   |:global|    
  ,        
    . 
  
       .    
          "mt". 
         : >

	:'t+1,.g/^/m 't

==============================================================================
*12.5*	ޣ 

    ,        .
Vim     .
    ޣ      >

	g CTRL-G

     :
	
	 1  0; . 141  157;  748  774;  4489  4976 ~
	
           (748)  
    (774).

 ,     ,    ,  
,          
  ,      
,     g CTRL-G.     :

	 5  293 ; 70  1884 ; 359  10928  ~

  ޣ ,      
|ޣ__|.

==============================================================================
*12.6*	   man                   *find-manpage* *__man*

        C  
   -     
man ( Unix).    :   
    >

	K

Vim    "man"      .
  ,    .   
 -,  "more".   , 
<Enter>    Vim.

 ,       man  ,  
 , .     man 
   Vim.       man: >

	:source $VIMRUNTIME/ftplugin/man.vim

      ,  
    vimrc.    man   Vim!
: >

	:Man csh

 ,   .      , 
  ,  CTRL-W w.
      man  -  , 
 . ,  "echo(3)": >

	:Man 3 echo

     man,  CTRL-]  . 
  ":Man"      . 

    ,    , 
: >

	\K

(   <Leader>,     
  ).
,    ,   "strstr()"  
 :

	if (strstr(input, "aap") == ) ~

    "strstr"   "\K".  ,  
  strstr().

==============================================================================
*12.7*	  

         
  .       
,  : >

	:%s/\s\+$//

   "%",        .
,     ":substitute" -- "\s\+$". 
  1    (\+)   (\s)
   ($).  ,     , 
|usr_27.txt|.
    ""  substitute : "//".  , 
   ,   ,   .

     --   .
       ,   ! ,
    ,     >

	/<Space><Tab>

     "x",   ,  
  .   ģ,    
 ݣ   .     ,
 "n".       ,   
  .

==============================================================================
*12.8*	 ,   

   UNIX,     Vim   grep
   ,   .  
,         
  ,  ̣ .
   , ,         C,
  "frame_counter".     : >

	vim `grep -l frame_counter *.c`

    .  grep    
 .    -l,      ,
    ,     .
        .
(:     grep    Vim  
  ).
          .  
 UNIX,        ţ
   .  ,    grep,
 ,      . 
      ":next", ":first"  ..


  

     ,    
.         .
   Vim   ,      
 . ,         C
 "error_string",   >

	:grep error_string *.c

  Vim   ,   "error_string" 
      .    
,   ,     ,  
":cnext".       
":cprev".       
":clist".
    ":grep"    grep ( Unix)  findstr (
Windows).     ,  
'grepprg'.

==============================================================================

 : |usr_20.txt|      
 : . |___|  

vim:tw=78:ts=8:ft=help:norl:
