vim学習資料


通常モード:

    (n)d(w,$,d)   
       r(v)       v
    (n)c(w,$,d)   ,        
    
      p            
      u ---> win  ctrl+z     
      U             
      ctrl + r         (u  ,    ,ctrl + r           )
      
      (300)shift + g    300 
           ctrl + g         (  ,   。。。)

     :r TEST  test             
     o        .       .shift + o     .
      
  :
/word  n     .shift + n     .
?word    

This ( is a test line with ('s, ['s ] and {'s } in it. ))

       , %,          

:w
:10,100 w TEST   10  100    


置換



:s/thee/the/g      thee     the.    /g           thee

                 old        new,     :s/old/new
                  old        new,     :s/old/new/g
                  old        new,     :#,#s/old/new/g
                  old        new,     :%s/old/new/g
                          c   ,    :%s/old/new/gc



===============================================================================
=                            《 V I M       》   ——        1.5      =
===============================================================================
     vim                     。    ,      
            。                    ,     
        ,        vim                。

                 25-30  ,         。

                   。            ,      
         (      "vimtutor"      ,           )。

         ∶                  。    ,     
                     。           ,     
               !

       ,       Shift-Lock(      )     ,      
          j            ,                。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			      ∶    


   ※※      ,          h、j、k、l  。 ※※

	     ^
	     k		      ∶ h       ,          。
       < h	 l >		   l       ,          。
	     j			   j                  。
	     v

  1.            ,         。

  2.      (j),          。

--->                   。

  3.         ,         。

  ∶              ,   <ESC>     (Normal)  。
                     。

  ∶            。    hjkl ,           
                  。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			      ∶VIM      


  !!     ∶            ,              。

  1.   <ESC> (             )。

  2.     ∶			:q! <  >

--->                             。
                ,   ∶
				:wq  <  >

  3.             ,               ,   ∶

		vimtutor <  >

                   ∶

		vim tutor <  >

--->     'vim'     vim   ,  'tutor'           。

  4.                   ,    1     3  , 
             。                        。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			      ∶       


   **    (Normal)   ,     x              。**

  1.                 --->     。

  2.         ,                 。

  3.      x          。

  4.     2   4,        。

---> The ccow jumpedd ovverr thhe mooon.

  5.   ,       ,            。

    ∶        ,      。    ∶      。



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		           ∶       


	 **       ,     i       。**

  1.                 --->     。

  2.                ,                 
        。

  3.      i  ,           。

  4.          ,    <ESC>        。
         2   4      。

---> There is text misng this .
---> There is some text missing from this line.

  5.                ,          。



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			            


  1.                   ,      hjkl    。
	 h (  )	j (  )       k (  )	    l (  )

  2.    vim   (       ),   ∶vim     <  >

  3.    vim   ,             ∶

	<ESC>   :q!	 <  >

                   ∶

	<ESC>   :wq	 <  >

  4.                  ,  ∶ x

  5.                     ,  ∶

	 i           	<ESC>

    ∶   <ESC>                          
   。

  ,       。             。


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			      ∶     


	    **    dw              /     。**

  1.     <ESC>           。

  2.                 --->     。

  3.                  。

  4.      dw       。

      ∶      dw                   。    
     ,    <ESC>    ,      。

---> There are a some words fun that don't belong paper in this sentence.

  5.     3   4,        。            。



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		            ∶       


		   **    d$           。**

  1.     <ESC>           。

  2.                 --->     。

  3.             (         ‘.’  )。

  4.      d$            。

---> Somebody typed the end of this line twice. end of this line twice.


  5.                     。





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		           ∶       


       d      ∶

	 [number]   d	object	           d	 [number]   object

      ∶
    number -          (   ,      1 )。
    d -     。
    object -            (       )。

           ∶
    w -              /    ,    。
    e -              /    ,   * *     。
    $ -                。

    ∶
           ,                        , 
                           。




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		      ∶         


	       **    dd           。 **

            ,VIM              ,        
       d               。

  1.                       。
  2.    dd     。
  3.         。
  4.      2dd (         number-command-object  ?)     。

      1)  Roses are red,
      2)  Mud is fun,
      3)  Violets are blue,
      4)  I have a car,
      5)  Clocks tell time,
      6)  Sugar is sweet
      7)  And so are you.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			       ∶     


	 **    u           ,   U      。**

  1.                 --->     ,          
      。
  2.    x             。
  3.      u        (  )  。
  4.       x          。
  5.           U ,          。
  6.        u     U        。
  7.        CTRL-R (    CTRL     ,     R  ) ,   
             ,          。

---> Fiix the errors oon thhis line and reeplace them witth undo.

  8.            。          。




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			            


  1.            /    ,   ∶dw

  2.               ,   ∶d$

  3.      ,   ∶dd

  4.               ∶

       [number]   command   object            command	[number]   object
        ∶
       number -            
       command -        ,   d     
       object -         ,   w     /  ,$        。
		$ (to the end of line), etc.

  5.         ,   ∶u (   u)
                 ,   ∶U (   U)
               ,         ,   ∶CTRL-R

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			       ∶     


	       **    p                  **

  1.                    。

  2.    dd      ,         vim     。

  3.                   。  ∶    。

  4.         (<ESC>   ),   p        。

  5.     2   4,                。

     a) Roses are red,
     b) Violets are blue,
     c) Intelligence is learned,
     d) Can you learn too?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		             ∶     


	  **    r                 。**

  1.                 --->     。

  2.                 。

  3.      r ,           。

  4.     2   3,           。

--->  When this lime was tuped in, someone presswd some wrong keys!
--->  When this line was typed in, someone pressed some wrong keys!

  5.               。

    ∶          ,         。



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			      ∶     


	   **        /         ,    cw **

  1.                 --->     。

  2.           lubw     u      。

  3.      cw          (         ine 。)

  4.     <ESC>  ,                       。

  5.     3   4,                。

---> This line has a few words that need changing using the change command.
---> This line has a few words that need changing using the change command.

  ∶    cw              ,            。



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		             ∶  c          


	     **                        。**

  1.                     。     ∶

       [number]   c   object	     	    c	[number]   object

  2.          ,   w     /  ,$      。

  3.                 --->     。

  4.               。

  5.      c$                   。    <ESC>  。

---> The end of this line needs some help to make it like the second.
---> The end of this line needs to be corrected using the  c$  command.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			            


  1.               ,        p。         
                。              ,      
                 。

  2.             ,       r              
        。

  3.                ,                。
          cw                  ;   c$      
              。

  4.          ∶

	 [number]   c	object	        	c   [number]   object

           。



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		           ∶       


  **    CTRL-g                           。
        SHIFT-G                。**

    ∶          ,           !!!

  1.    CTRL         g  。                  
       ,                     。     3   。

  2.    SHIFT-G                     。

  3.          ,     SHIFT-G。              
     CTRL-g        。  ∶     ,             
      。

  4.     ,         1    。



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			      ∶     


     **    /                         。**

  1.          /   。                     
      ,   :       。

  2.      errroor <  >。  errroor          。

  3.            ,     n  。              
       ,    Shift-N   。

  4.            ,    ?    /   。

---> When the search reaches the end of the file it will continue at the start.

  "errroor" is not the way to spell error;  errroor is an error.

    ∶            ,              。



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		         ∶       


	      **   %           )、]、}。**

  1.              -->           (、[   {  。

  2.     %   。

  3.                  。

  4.     %               。

---> This ( is a test line with ('s, ['s ] and {'s } in it. ))

  ∶      ,                   。






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		            ∶         


		**    :s/old/new/g      old   new。**

  1.                 --->     。

  2.    :s/thee/the <  > 。                    
      。

  3.    :s/thee/the/g	          。

---> the best time to see the flowers is in the spring.

  4.                ,    :#,#s/old/new/g (#,#    
          )。   :%s/old/new/g                。




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			            


  1. Ctrl-g                    。Shift-G       
             。           Shift-G           
          。

  2.    /                               。
          ?                             
       。          n            ,        
              ;    Shift-N               。

  3.            (、)、[、]、{、},  %            
        。

  4.              old        new,     :s/old/new
                  old        new,     :s/old/new/g
                  old        new,     :#,#s/old/new/g
                  old        new,     :%s/old/new/g
                          c   ,    :%s/old/new/gc


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		      ∶  VIM           


	   **    :!                       。**

  1.          :            。            。

  2.         !     ,            shell    。

  3.     ls     。   !ls <  > 。              
       ,               ls        。   !ls   
       ,      :!dir   。

--->   ∶                  。

--->   ∶     :        <  >   。




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		            ∶           


	     **               ,    :w FILENAME 。**

  1.    :!dir    :!ls          。           
     <  >  。

  2.            ,   TEST 。

  3.      :w TEST  (   TEST          。)

  4.       TEST            (VIM   )。        ,
           :!dir           。

--->    ∶      VIM         TEST      ,      
                        。

  5.           :!rm TEST     TEST    。



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		          ∶            


		**           ,    :#,# w FILENAME **

  1.        :!dir    :!ls          ,         
            ,   TEST 。

  2.               ,    CTRL-g        。   
        。

  3.               ,     CTRL-g 。         。

  4.             ,    :#,# w TEST 。    #,#     
             (    ,    ),  TEST         。

  5.   ,  :!dir           。         。




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		         ∶       


       **                  ,    :r FILENAME **

  1.     :!dir          TEST     。

  2.                。

    ∶     3            ,             。

  3.      :r TEST          TEST        。

    ∶                      。

  4.             ,                    
          ,     ,            。



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			            


  1. :!command            command。

             ∶
	  :!dir  -             。
	  :!rm FILENAME  -	       FILENAME    。

  2. :w FILENAME       VIM               FILENAME   
       。

  3. :#,#w FILENAME           #     #          
     FILENAME  。

  4. :r FILENAME         FILENAME                
       。







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			       ∶     


	 **    o                     。**

  1.                 --->     。

  2.         o     *  *              。

  3.         --->      <ESC>               。

---> After typing  o  the cursor is placed on the open line in Insert mode.

  4.       *  *       ,         O        o
         。         。          ,  Shift-O  
              。

Open up a line above this by typing Shift-O while the cursor is on this line.





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			      ∶        


		     **    a            。 **

  1.             $                --->     
        。

  2.         a             。    A        
          。

  ∶     A               ,      i,     
            ,     ,<ESC>       ,          
      x                      。

  3.                。                 
           ,                 。

---> This line will allow you to practice
---> This line will allow you to practice appending text to the end of a line.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		          ∶            


		      **       R          。**

  1.                 --->     。

  2.                --->              ,  
       last  。

  3.         R                        , 
                               。

---> To make the first line the same as the last on this page use the keys.
---> To make the first line the same as the second, type R and the new text.

  4.    ∶     <ESC>             ,         
          。





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			          ∶        


		  **                     **


  1.       ignore           /ignore 。       ,  
         n  。

  2.      ic   (ic         Ignore Case       ), 
       ∶
	:set ic

  3.          n         ignore。           n  。

  4.      hlsearch   incsearch      ,      ∶
     :set hls is

  5.             ,        ∶
     /ignore

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
			            


  1.       o                         ,  
         。
           O                         ,  
         。

  2.       a                。
           A                  。

  3.       R        ,    <ESC>             
       。

  4.    :set xxx      xxx   。









~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		          ∶      

		      **          **

  Vim                。        ,        
     ∶
	-    <HELP>   (        )
	-    <F1>   (        )
	-   	:help <  >

     :q <  >         。

            ":help"  ,             。    
     (         。:)∶

	  :help w <  >
	  :help c_<T <  >
	  :help insert-index <  >
	  :help user-manual <  >




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
		          ∶        

			  **   vim    **

  Vim       vi   ,             。       
    ,      vimrc  。

  1.     vimrc  ,             ∶

     :edit ~/.vimrc		  Unix        
     :edit $VIM/_vimrc		  Windows        

  2.     vimrc    ∶

     :read $VIMRUNTIME/vimrc_example.vim

  3.     ,   ∶

     :write

        vim   ,              。        
               vimrc   。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  vim       。              vim   ,      
              。    ,vim         ,     
          。        ,       。        
  vim  ,      ∶
	:help user-manual

              ,         ∶

	Vim - Vi Improved -   ∶Steve Oualline
	   ∶New Riders

           vim   。         。          
     。    ,    http://iccf-holland.org/click5.html

                  vi   vim,       ∶

	Learning the Vi Editor -   ∶Linda Lamb
	   ∶O'Reilly & Associates Inc.

          ,             vi       。    
              vim   。

         Calorado School of Minese Michael C. Pierce、Robert K.
  Ware     ,    Colorado State University Charles Smith   
      。       ∶

	[email protected]

       Bram Moolenaar  vim    。



       ∶
  ===========
                        <[email protected]>,  
              ∶[email protected]。

                          Debian GNU/Linux      
                         autoconvert      ,   
                   。

      ∶
  =========
      2002 08 30      <[email protected]>
         RMS@SMTH    ,       。

      2002 04 22      <[email protected]>
         [email protected]    ,        。

      2002 03 18      <[email protected]>
        Bram Molenaar   2002 03 16      , vimtutor1.4  
          vimtutor1.5。

      2001 11 15      <[email protected]>
       vimtutor1.4      Bram Molenaar Sven Guckes。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~