Vim Chinese tutor

Source: Internet
Author: User
Vim Chinese tutor

Vim is a powerful editor with many commands. This document will not be detailed in this tutorial. The purpose of this tutorial is to describe some necessary basic commands. With these commands, you can easily use Vim as a universal editor.

It takes about 25-30 minutes to complete this tutorial, depending on your training time.

The command operations in each section will change this article. We recommend that you copy a copy of this article and then perform training on the copy (if you start the tutorial through "vimtutor", this article is already a copy ).

Remember: the design concept of this tutorial is learned during use. That is to say, You need to execute commands to learn their correct usage. If you only read these commands without performing any operations, you may soon forget these commands!

Now, please make sure that your shift-lock (case-insensitive key) has not been pressed, and then press the keys J on the keyboard enough times to move the cursor, until the content in section 1 is fully filled with the screen.

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

Lecture 1 Section 1: move the cursor

※To move the cursor, press the H, J, K, and l keys respectively. ※※

^
K indicates that the key of H is on the left, and is moved to the left every time you press it.
<H L> L's key is on the right. Each press will move to the right.
The J key looks like a downward arrow at the tip.
V

1. move the cursor freely on the screen until you feel comfortable.

2. Press the downstream key (j) until the cursor repeats.

-> Now you have learned how to move to the next lecture.

3. now use the downstream key to move the cursor to lecture 2.

Tip: If you are not sure about the letter you press, press <ESC> to return to normal mode. Enter the command you want on the keyboard again.

Tip: The cursor key should work properly. However, with the hjkl key, you can move the cursor around the screen quickly.

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

Lecture 1 Section 2: Vim entry and exit

!! Note: Please read the entire section before you can execute the commands described below.

1. Press the <ESC> key to ensure that you are in normal mode ).

2. Enter: Q! <Press enter>

-> Exiting the editor in this way will never save the changes you have made since entering the editor.
If you want to save the changes and exit, enter:
: WQ <press enter>

3. If you see a command line prompt, enter the command that can bring you back to this tutorial, that is:

Vimtutor <press enter>

In general, you can also use this method:

Vim tutor <press enter>

-> Here 'vim 'indicates entering the vim Editor, while 'tutor' indicates the file you want to edit.

4. If you are confident that you have kept these steps in mind, please exit from step 1 to Step 3 and then go to the editor again. Next, move the cursor to section 3 of the first lecture to continue our tutorial.

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

Section 3: delete text editing

** In normal mode, you can press the X key to delete the characters at the cursor position. **

1. move the cursor to the line marked with-> below this section.

2. to correct input errors, move the cursor to the position of the character to be deleted.

3. Press the X key to delete the error characters.

4. Repeat steps 2 to 4 until the sentence is corrected.

-> The ccow jumpedd ovverr thhe mooon.

5. Now, the row has been corrected. The next section is the fourth section of the first lecture.

Note: Do not force your memory when you browse this tutorial. Remember: Learn in use.

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

Section 1 and section 4: text editing and insertion

** In normal mode, you can press I to insert text. **

1. move the cursor to the first line marked with-> below this section.

2. To make the content of the first line similar to that of the second line, move the cursor to the first character of the text to prepare for insertion.
.

3. Press the I key and enter necessary text characters.

4. All texts have been corrected. Press <ESC> to return to normal mode.
Repeat steps 2 to 4 to correct sentences.

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

5. If you are satisfied with the text insertion Operation, please read the following summary.

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

Summary

1. move the cursor in the screen text. You can use either the arrow keys or the hjkl keyboard key.
H (left shift) J (downstream) K (upstream) L (right shift)

2. To enter the vim Editor (from the command line prompt), enter the: Vim file name <press enter>

3. to exit the vim Editor, enter the following command to discard all modifications:

<ESC>: Q! <Press enter>

Alternatively, run the following command to save all the changes:

<ESC>: WQ <press enter>

4. Delete the character at the cursor position in normal mode. Press: X.

5. In normal mode, to insert text at the cursor position, Press:

I. Enter necessary text <ESC>

Note: pressing the <ESC> button will bring you back to normal mode or cancel a command that is not expected or partially completed.

Okay. The first step is to end. Next we will continue with the second lecture.

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

Lecture 2 Section 1: delete commands

** Input DW can be deleted from the cursor to the end of a single word/word. **

1. Press <ESC> to make sure that you are in normal mode.

2. move the cursor to the line marked with-> below this section.

3. move the cursor to the beginning of the word to be deleted.

4. Enter DW to delete the word.

Note: The DW you entered will appear on the last line of the screen at the same time. If the input is incorrect, press <ESC> to cancel the operation and try again.

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

5. Repeat steps 3 to 4 until the sentence is corrected. Next, let's continue with the second lecture.

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

Section 2: Other deletion commands

** Enter D $ to delete the cursor from the current cursor to the end of the row. **

1. Press <ESC> to make sure that you are in normal mode.

2. move the cursor to the line marked with-> below this section.

3. move the cursor to the end of the row (that is, after the first vertex ).

4. Enter d $ and delete it from the cursor to the end of the current row.

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

5. Continue to study section 3 to see what is going on.

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

Section 3 of the Second Lecture: About commands and objects

The format of the DELETE command D is as follows:

[Number] D object or d [number] Object

The meaning is as follows:
Number-indicates the number of times the command is executed (optional, 1 by default ).
D-Indicates deletion.
Object-indicates the object to be operated on by the Command (which is described below ).

A brief Object List:
W-from the current position of the cursor to the end of a word/word, including spaces.
E-from the current position of the cursor to the end of a word/word, but the space is not included.
$-From the current position of the current cursor to the end of the current row.

Note:
If you are brave in explorer, please press the key representing the corresponding object in normal mode without using the command, then you will see the movement of the cursor as represented by the object list above.

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

Section 2 and section 4: Special Cases of object commands

** Enter dd to delete the entire row. **

In view of the high frequency of row deletion, VIM designers decided to simplify the whole row deletion, only on the same row
After hitting d twice, you can delete the entire line where the cursor is located.

1. move the cursor to the second line in the short paragraph below this section.
2. Enter dd to delete the row.
3. Move to the fourth row.
4. Enter 2dd. (Do you still remember the number-command-object mentioned above ?) Delete two rows.

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.

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

Lecture 2 Section 5: Undo commands

** Enter U to undo the last command and enter U to correct the entire line. **

1. move the cursor to the line marked with-> below this section and place it in the first error.
.
2. Enter X to delete the first letter you do not want to retain.
3. Then enter U to undo the last executed (once) command.
4. Use X to correct all errors of the row this time.
5. Enter an uppercase u to restore the original state of the row.
6. Enter U multiple times to undo the U and change the previous command.
7. Then enter the CTRL-R multiple times (Press ctrl key not open, then enter the r key), so that
You can run the recovery command to undo the undo command.

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

8. These are very useful commands. The following is a summary of the second lecture.

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

Summary

1. to delete from the current cursor to the end of a word/word, enter: DW

2. to delete the cursor from the current row to the end of the current row, enter: d $

3. to delete the entire row, enter: dd

4. The format of the next command in normal mode is:

[Number] command object or command [number] Object

It means:
Number-indicates the number of command executions
Command-indicates what to do. For example, d Indicates deletion.
Object-indicates the object to be operated. For example, W represents a single word/Word, and $ represents the end of a row.

$ (To the end of line), etc.

5. to cancel the previous operation, enter U (lower case U)
To cancel the changes made in one row, enter U (uppercase U)
To undo the previous undo command, restore the results of the previous operation, enter: CTRL-R

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

Lecture 3 Section 1: Placement commands

** Input P to place the last deleted content after the cursor **

1. move the cursor to the first line of the demo section below this section.

2. Enter dd to delete the row. This will save the row to the vim buffer.

3. move the cursor over the position to be placed. Remember: It's the top.

4. Then, in normal mode (<ESC> enter), enter P to paste the row.

5. Repeat steps 2 to 4 to place all rows in the correct position in sequence.

D) Can you learn too?
B) violets are blue,
C) intelligence is learned,
A) Roses are red,

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

Section 3 Section 2: Replacement commands

** Enter R and a character to replace the character at the cursor position. **

1. move the cursor to the first line marked with-> below this section.

2. move the cursor to the right position of the first error.

3. Enter R to replace the error.

4. Repeat steps 2 and 3 until the first line has been modified.

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

5. Then we will continue with section 3 of the third lecture.

Note: Remember to learn in use rather than in memory.

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

Section 3: Change commands

** To change part or all of a single word/word, enter CW **

1. move the cursor to the first line marked with-> below this section.

2. Place the cursor at the u location of the lubw letter.

3. Enter CW to correct the word (in this example, input INE .)

4. Press the <ESC> key and then move the cursor to the first letter of the next error to be changed.

5. Repeat Steps 3 and 4 until the first sentence is exactly the same as the second sentence.

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

Tip: Please note that the CW command not only replaces a word, but also enables you to enter the text insertion status.

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

Section 3 and section 4: Other change-type commands using the C command

** You can change the object parameters used by class commands by using the same Delete class commands. **

1. Changing the operating method of class commands is the same as deleting class commands. The operation format is:

[Number] C object or C [number] Object

2. The same is true for object parameters. For example, W represents a single word/Word, and $ represents the end of a row.

3. move the cursor to the first line marked with-> below this section.

4. move the cursor to the first error.

5. Enter C $ to make the remaining part of the row correct the same as that of the second row. 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.

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

Summary

1. to re-insert the deleted text content, enter the lower-case letter P. This operation can place the deleted text content after the cursor. If the last row is deleted, the row is placed in the next row of the current cursor.

2. To replace the characters at the cursor position, enter the lower-case character R and the new character to replace the original character.

3. The change class command allows you to change the specified object from the current cursor position to the end of the object. For example, input CW can replace the content from the current cursor to the end of the word; input C $ can replace the content from the current cursor to the end of the line.

4. Change the class command format:

[Number] C object or C [number] Object

Next, let's continue with our next lecture.

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

Section 4 Section 1: positioning and file status

** Enter Ctrl-g to display the row position and file status information of the current cursor in the current editing file.
Enter the SHIFT-G to jump directly to a specified line in the file. **

Tip: you must read the content of this section before performing the following steps !!!

1. Press ctrl and press G. Then, a status information line is displayed at the bottom of the page, showing the currently edited file name and the total number of lines of the file. Remember the row number in step 3.

2. Press the SHIFT-G key to make the current cursor jump directly to the last line of the file.

3. Enter the row number you have stayed in, and then press shift-G. In this way, you can return the row where you pressed Ctrl-g for the first time. Note: When you enter a row number, the row number is not displayed on the screen.

4. If you want to, continue with steps 1 to 3.

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

Section 4 Section 2: search commands

** The input/and trailing strings can be used to search for the string in the current file. **

1. Enter/character in normal mode. You will notice that the character and the optical mark will appear at the bottom of the screen, which is the same as the command.

2. Enter errroor <press enter>. The errroor is the string you want to search.

3. To search for the same string as the previous one, you only need to press the n key. To search for the same string in the opposite direction, Enter Shift-n.

4. If you want to reverse query a string, use? Replace.

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

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

Tip: if the search has reached the end of the file, the search will automatically continue from the file header.

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

Section 4: Search for pair brackets

** Matching parentheses can be searched by %),], and}. **

1. Place the cursor below this section to mark any of the rows (, [, or.

2. Press % characters.

3. The position of the time mark should be in the matching brackets.

4. Press % again to jump back to the first bracket of the pair.

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

Tip: During program debugging, this function is useful for finding unpaired parentheses.

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

Lecture 4 Section 4: one of the methods to correct errors

** Input: S/old/new/g can replace old with new. **

1. move the cursor to the line marked with-> below this section.

2. Enter S/thee/the <press enter>. Note that this command only changes the first matching string of the row where the cursor is located.

3. Input: S/thee/The/g to replace the matching string of the entire row.

-> The best time to see thee flowers is in thee spring.

4. To replace each matching string between two rows, enter #, # S/old/new/g (#, # stands for the row number of the two rows ). Enter % S/old/new/g to replace each matching string in the entire file.

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

Conclusion 4

1. CTRL-G is used to display the current cursor position and file status information. Shift-G is used to jump the cursor to the last line of the file. First, knock in a row number and then press shift-g to move the cursor to the row represented by this row number.

2. Input/followed by a string, which is to be searched backward in the document currently edited. Enter question mark? Followed by a string, the string is searched forward in the document being edited. After a search is completed, press the n key to repeat the previous command. You can find the next string in the same direction, or press shift-N to find the string in the opposite direction.

3. If the current cursor position is parentheses (,), [,], {,}, you can move the cursor to the matching brackets by %.

4. Replace the header string old with the new string new in a row. Enter "s/old/new ".
Replace all the strings old with the new string new in one line. Enter: S/old/new/g.
Replace all the strings old with the new string new in the two rows. Enter: #, # S/old/new/g.
Replace all the strings old with the new string new in the file. Enter % S/old/new/g.
During full-text replacement, ask the user to confirm that C option is required for each replacement. Enter % S/old/new/GC.

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

Section 5 Section 1: how to execute External commands in VIM

** Input :! Then, enter an external command to execute the command. **

1. Press what we are familiar with: the command sets the cursor to the bottom of the screen. In this way, you can enter the command.

2. Enter an exclamation point! This character allows you to execute external shell commands.

3. Take the LS command as an example. Enter! Ls <press enter>. This command will list the contents of your current directory, just as the result of entering the LS command at the command line prompt. If! Ls does not work. You can try :! Dir.

-> Note: all external commands can be executed in this way.

-> Tip: All commands must end with <press enter>.

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

Section 5 section II: more information on saving files

** To save changes to the file, enter W filename. **

1. Enter :! DIR or :! Ls obtains the content of the current directory. You should have known that you have to press <enter>.

2. Select a file name that does not exist, such as test.

3. Enter W test (here test is the selected file name .)

4. This command saves the entire file with the file name test (Vim tutorial ). To ensure correct saving, enter again :! Dir to view the contents of your directory list.

-> Note: If you exit vim and enter the file with the file name test as the parameter, the file content should be exactly the same as the file content you saved.

5. Now you can enter :! Rm test to delete the test file.

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

Section 5: a selective saving command

** To save part of the file, enter: #, # W filename **

1. Run it again :! DIR or :! Ls gets the content of the current directory, and then selects a suitable file name without duplicate names, such as test.

2. move the cursor to the top of the page, and press Ctrl-g to find the row number. Don't forget the row number.

3. move the cursor to the bottom of the page and press Ctrl-G again. Don't forget the row number.

4. To save only a part of the article, enter: #, # W test. Here, #, # Is the row number (the top row number and the bottom row number) that you need to remember, and test is the selected file name.

5. Finally, use :! Dir: Check whether the file is correctly saved. But do not delete it this time.

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

Section 5: extracting and merging files

** To insert the content of another file into the current file, enter R filename **

1. Enter :! Dir confirm that the test file you created earlier is still in.

2. move the cursor to the top of the current page.

Note: After step 3 is executed, you will see section 3 of lecture 5. Please move it back here.

3. Use R test to extract the file named test.

Note: The extracted file will be placed at the position of the cursor.

4. to confirm that the file has been extracted successfully, move the cursor back to the original position. Note that there are two copies in section 3 of the fifth lecture, one is the original and the other is a copy from the file.

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

Summary

1 .:! Command is used to execute an external command.

See some examples:
:! Dir-displays the content of the current directory.
:! Rm filename-used to delete a file named filename.

2.: W filename can save the file being edited in VIM to the file named filename.

3.: #, # W filename can save the content of row # To row # Of the current edited file to the file filename.

4.: R filename extracts the disk file filename and inserts it behind the cursor position of the current file.

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

Section 6 Section 1: Open Class commands

** Input o opens a new line under the cursor and enters the insert mode. **

1. move the cursor to the line marked with-> below this section.

2. Enter the lower-case o at the bottom of the cursor * to open a new line and enter the insert mode.

3. Copy the row marked with "->" and press the <ESC> key to exit the insert mode and enter the normal mode.

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

4. To open a new line at the top of the cursor *, you only need to input uppercase O instead of lowercase O. Please try it in the next test. When the cursor is over the row, you can press shift-O to open a new row above the row.

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

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

Section 6 Section 2: insert command after the cursor

** Input a will insert text after the cursor. **

1. In normal mode, move the cursor to the end of the first line marked with-> below this section by entering $.

2. Enter lowercase A to insert text after the cursor. In upper case, a can insert text directly at the end of the row.

Tip: you can insert text at the end of a line by inputting uppercase A to avoid entering I. move the cursor to the last character and enter the text. <ESC> return to normal mode, right-click the arrow to move the cursor and X to delete the characters at which the current cursor is located.

3. You can complete the first line after the operation. Note that the insert text behind the cursor is basically the same as the insert mode, but the position of the insert text is slightly different.

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

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

Section 6: Section 3: version of another replacement command

** You can enter uppercase letters to replace multiple consecutive characters in R. **

1. move the cursor to the first line marked with-> below this section.

2. move the cursor to the beginning of the first word in the second line different from the one marked with->, that is, the last word.

3. then input the uppercase R to start inputting the remaining characters in the first line different from the second line one by one. Then you can replace all the original characters so that the first line is completely the same as the second line.

-> 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. Note: If you press <ESC> to exit the replacement mode and return to the normal mode, the text that has not been replaced will remain unchanged.

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

Section 6 and section 4: Set options for class commands

** Set options for case-insensitive search or replacement **

1. To search for the word ignore, enter/ignore in normal mode. To search for the word again, you can press n again.

2. Then set the IC option (IC is the abbreviation of the first letter in case ignore case is ignored in English), that is, enter:
: Set IC

3. Now you can search for the word ignore again by typing the n key. You can type N for repeated searches.

4. Set the hlsearch and incsearch options and enter the following content:
: Set HLS is

5. Now you can enter the search command again to see what the result will be:
/Ignore

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

Summary

1. Input lowercase o to open a new line under the cursor and place the cursor at the beginning of the new line to enter the insert mode.
Enter an uppercase o to open a new line above the cursor and place the cursor at the beginning of the new line to enter the insert mode.

2. Input lowercase A to insert text after the cursor position.
Input uppercase A can insert text after the end of the row where the cursor is located.

3. If you enter an uppercase value, r enters the replacement mode until you press <ESC> to exit the replacement mode and enter the normal mode.

4. Input: Set XXX to set the xxx option.

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

Lecture 7: online help commands

** Use the online help system **

Vim has a comprehensive online help system. To start the help system, select one of the following three methods:
-Press the -Press the <F1> key (if any on the keyboard)
-Input: Help <press enter>

Enter q <press enter> to close the Help window.

Provide a correct parameter to the ": Help" command. You can find help on this topic. Test the following parameters (do not forget to press Enter. :

: Help W <press enter>
: Help C _ <t <press enter>
: Help insert-index <press enter>
: Help user-manual <press enter>

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

Lecture 8: Create a STARTUP script

** Enable Vim **

Vim has many more features than vi, but most features are not activated by default. To enable more functions, you must create a vimrc file.

1. Start editing the vimrc file, depending on the operating system you are using:

: Edit ~ /. Vimrc this is the command used by the UNIX System
: Edit $ Vim/_ vimrc: The Command Used in windows.

2. Import the vimrc sample file:

: Read $ vimruntime/vimrc_example.vim

3. Save the file. The command is:

: Write

When you start Vim next time, the editor will have the syntax highlighting function. You can continue to add other feature settings you like to this vimrc file.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.