⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tutor

📁 MSYS在windows下模拟了一个类unix的终端
💻
📖 第 1 页 / 共 2 页
字号:
================================================================================    W e l c o m e   t o   t h e   V I M   T u t o r    -    Version 1.4      ================================================================================     Vim is a very powerful editor that has many commands, too many to     explain in a tutor such as this.  This tutor is designed to describe     enough of the commands that you will be able to easily use Vim as     an all-purpose editor.     The approximate time required to complete the tutor is 25-30 minutes,     depending upon how much time is spent with experimentation.     The commands in the lessons will modify the text.  Make a copy of this     file to practise on (if you started "vimtutor" this is already a copy).     It is important to remember that this tutor is set up to teach by     use.  That means that you need to execute the commands to learn them     properly.  If you only read the text, you will forget the commands!     Now, make sure that your Shift-Lock key is NOT depressed and press     the   j   key enough times to move the cursor so that Lesson 1.1     completely fills the screen.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~			Lesson 1.1:  MOVING THE CURSOR   ** To move the cursor, press the h,j,k,l keys as indicated. **	     ^	     k		    Hint:  The h key is at the left and moves left.       < h	 l >		   The l key is at the right and moves right.	     j			   The j key looks like a down arrow	     v  1. Move the cursor around the screen until you are comfortable.  2. Hold down the down key (j) until it repeats.---> Now you know how to move to the next lesson.  3. Using the down key, move to Lesson 1.2.Note: If you are ever unsure about something you typed, press <ESC> to place      you in Normal mode.  Then retype the command you wanted.Note: The cursor keys should also work.  But using hjkl you will be able to      move around much faster, once you get used to it.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~		     Lesson 1.2: ENTERING AND EXITING VIM  !! NOTE: Before executing any of the steps below, read this entire lesson!!  1. Press the <ESC> key (to make sure you are in Normal mode).  2. Type:     			:q! <RETURN>.---> This exits the editor WITHOUT saving any changes you have made.     If you want to save the changes and exit type:     				:wq  <RETURN>  3. When you see the shell prompt, type the command that got you into this     tutor.  That could be:	vimtutor <RETURN>     Normally you would use:	vim tutor <RETURN>---> 'vim' means enter the vim editor, 'tutor' is the file you wish to edit.  4. If you have these steps memorized and are confident, execute steps     1 through 3 to exit and re-enter the editor.  Then move the cursor down     to Lesson 1.3.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~		     Lesson 1.3: TEXT EDITING - DELETION** While in Normal mode press	x  to delete the character under the cursor. **  1. Move the cursor to the line below marked --->.  2. To fix the errors, move the cursor until it is on top of the     character to be deleted.  3. Press the	x  key to delete the unwanted character.  4. Repeat steps 2 through 4 until the sentence is correct.---> The ccow jumpedd ovverr thhe mooon.  5. Now that the line is correct, go on to Lesson 1.4.NOTE: As you go through this tutor, do not try to memorize, learn by usage.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~		     Lesson 1.4: TEXT EDITING - INSERTION	 ** While in Normal mode press  i  to insert text. **  1. Move the cursor to the first line below marked --->.  2. To make the first line the same as the second, move the cursor on top     of the first character AFTER where the text is to be inserted.  3. Press  i  and type in the necessary additions.  4. As each error is fixed press <ESC> to return to Normal mode.     Repeat steps 2 through 4 to correct the sentence.---> There is text misng this .---> There is some text missing from this line.  5. When you are comfortable inserting text move to the summary below.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~			       LESSON 1 SUMMARY  1. The cursor is moved using either the arrow keys or the hjkl keys.	 h (left)	j (down)       k (up)	    l (right)  2. To enter Vim (from the % prompt) type:  vim FILENAME <RETURN>  3. To exit Vim type:	   <ESC>   :q!	 <RETURN>  to trash all changes.	     OR type:	   <ESC>   :wq	 <RETURN>  to save the changes.  4. To delete a character under the cursor in Normal mode type:  x  5. To insert text at the cursor while in Normal mode type:	 i     type in text	<ESC>NOTE: Pressing <ESC> will place you in Normal mode or will cancel      an unwanted and partially completed command.Now continue with Lesson 2.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~			Lesson 2.1: DELETION COMMANDS	    ** Type  dw  to delete to the end of a word. **  1. Press  <ESC>  to make sure you are in Normal mode.  2. Move the cursor to the line below marked --->.  3. Move the cursor to the beginning of a word that needs to be deleted.  4. Type   dw	 to make the word disappear.  NOTE: The letters dw will appear on the last line of the screen as you type	them. If you typed something wrong, press  <ESC>  and start over.---> There are a some words fun that don't belong paper in this sentence.  5. Repeat steps 3 and 4 until the sentence is correct and go to Lesson 2.2.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~		      Lesson 2.2: MORE DELETION COMMANDS	   ** Type  d$	to delete to the end of the line. **  1. Press  <ESC>  to make sure you are in Normal mode.  2. Move the cursor to the line below marked --->.  3. Move the cursor to the end of the correct line (AFTER the first . ).  4. Type    d$    to delete to the end of the line.---> Somebody typed the end of this line twice. end of this line twice.  5. Move on to Lesson 2.3 to understand what is happening.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~		     Lesson 2.3: ON COMMANDS AND OBJECTS  The format for the  d  delete command is as follows:	 [number]   d	object	    OR	     d	 [number]   object  Where:    number - is how many times to execute the command (optional, default=1).    d - is the command to delete.    object - is what the command will operate on (listed below).  A short list of objects:    w - from the cursor to the end of the word, including the space.    e - from the cursor to the end of the word, NOT including the space.    $ - from the cursor to the end of the line.NOTE:  For the adventurous, pressing just the object while in Normal mode       without a command will move the cursor as specified in the object list.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~		Lesson 2.4: AN EXCEPTION TO  'COMMAND-OBJECT'	       ** Type	 dd   to delete a whole line. **  Due to the frequency of whole line deletion, the designers of Vim decided  it would be easier to simply type two d's in a row to delete a line.  1. Move the cursor to the second line in the phrase below.  2. Type  dd  to delete the line.  3. Now move to the fourth line.  4. Type   2dd   (remember  number-command-object) to delete the two lines.      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.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~			 Lesson 2.5: THE UNDO COMMAND   ** Press  u	to undo the last commands,   U	 to fix a whole line. **  1. Move the cursor to the line below marked ---> and place it on the     first error.  2. Type  x  to delete the first unwanted character.  3. Now type  u  to undo the last command executed.  4. This time fix all the errors on the line using the  x  command.  5. Now type a capital  U  to return the line to its original state.  6. Now type  u  a few times to undo the  U  and preceding commands.  7. Now type CTRL-R (keeping CTRL key pressed while hitting R) a few times     to redo the commands (undo the undo's).---> Fiix the errors oon thhis line and reeplace them witth undo.  8. These are very useful commands.  Now move on to the Lesson 2 Summary.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~			       LESSON 2 SUMMARY  1. To delete from the cursor to the end of a word type:    dw  2. To delete from the cursor to the end of a line type:    d$  3. To delete a whole line type:    dd  4. The format for a command in Normal mode is:       [number]   command   object     OR     command	[number]   object     where:       number - is how many times to repeat the command       command - is what to do, such as  d  for delete       object - is what the command should act upon, such as  w (word),		$ (to the end of line), etc.  5. To undo previous actions, type:	     u	 (lowercase u)     To undo all the changes on a line type: U	 (capital U)     To undo the undo's type:		     CTRL-R~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~			 Lesson 3.1: THE PUT COMMAND       ** Type	p  to put the last deletion after the cursor. **  1. Move the cursor to the first line in the set below.  2. Type  dd  to delete the line and store it in Vim's buffer.  3. Move the cursor to the line ABOVE where the deleted line should go.  4. While in Normal mode, type    p	 to replace the line.  5. Repeat steps 2 through 4 to put all the lines in correct order.     d) Can you learn too?     b) Violets are blue,     c) Intelligence is learned,     a) Roses are red,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~		       Lesson 3.2: THE REPLACE COMMAND  ** Type  r  and a character to replace the character under the cursor. **  1. Move the cursor to the first line below marked --->.  2. Move the cursor so that it is on top of the first error.  3. Type   r	and then the character which should replace the error.  4. Repeat steps 2 and 3 until the first line is correct.--->  Whan this lime was tuoed in, someone presswd some wrojg keys!--->  When this line was typed in, someone pressed some wrong keys!  5. Now move on to Lesson 3.2.NOTE: Remember that you should be learning by use, not memorization.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~			Lesson 3.3: THE CHANGE COMMAND	   ** To change part or all of a word, type  cw . **  1. Move the cursor to the first line below marked --->.  2. Place the cursor on the u in lubw.  3. Type  cw  and the correct word (in this case, type  'ine'.)  4. Press <ESC> and move to the next error (the first character to be changed.)  5. Repeat steps 3 and 4 until the first sentence is the same as the second.---> This lubw has a few wptfd that mrrf changing usf the change command.---> This line has a few words that need changing using the change command.Notice that  cw  not only replaces the word, but also places you in insert.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~		       Lesson 3.4: MORE CHANGES USING c     ** The change command is used with the same objects as delete. **  1. The change command works in the same way as delete.  The format is:       [number]   c   object	   OR	    c	[number]   object  2. The objects are also the same, such as   w (word), $ (end of line), etc.  3. Move to the first line below marked --->.  4. Move the cursor to the first error.  5. Type  c$  to make the rest of the line like the second and press <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.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~			       LESSON 3 SUMMARY  1. To replace text that has already been deleted, type   p .	This Puts the     deleted text AFTER the cursor (if a line was deleted it will go on the     line below the cursor).  2. To replace the character under the cursor, type   r   and then the     character which will replace the original.  3. The change command allows you to change the specified object from the     cursor to the end of the object.  eg. Type  cw  to change from the     cursor to the end of the word, c$	to change to the end of a line.  4. The format for change is:	 [number]   c	object	      OR	c   [number]   objectNow go on to the next lesson.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -