Vim use case

Source: Internet
Author: User

1. Please create a directory named Vitest in the/tmp directory;

2. Enter the Vitest directory;

3. Copy the/etc/man.config to the directory below (or download the Man.config file from the link above);

4. Use VI to open the Man.config file under this catalogue;

5. Set the line number in VI;

6. Move to line 58th and move 40 characters to the right, what directory are you seeing in double quotes?

7. Move to the first line, and search down the string "bzip2", may I ask what line he is in?

8. Next down, I'm going to change the "lowercase man string" between 50 and 100 rows to "uppercase man string", and if a selection needs to be modified, how do I place an instruction? If you keep pressing "Y" during the selection process, the result will change a few guys in the last line.

9. After the modification, all of a sudden regret, to recover all, what are the methods?

10. I want to copy the contents of the nine lines (containing Manpath_map) from 65 to 73, and post them to the last line;

11.21 to 42 annotation data at the beginning of the # symbol I don't want it, how do I delete it?

12. Save this file as a man.test.config name;

13. Go to line 27th and delete 15 characters, what is the first word that appears?

14. Add a row to the first line, and the line input "I am a student ...";

15. Save and leave!

The entire step can be shown as follows:

1. "Mkdir/tmp/vitest"

2. "Cd/tmp/vitest"

3. "Cp/etc/man.config."

4. "Vi man.config"

5. ": Set Nu" Then you will see the number on the left appears as the line number.

6. Press "58G" and press "40→" to see the word "/dir/bin/foo" in double quotation marks;

7. Perform "1G" or "GG" first, enter "/BZIP2" directly, then go to line 118th!

8. Direct release ": 50,100S/MAN/MAN/GC" Can! If you press "Y" all the time, the "replace 25 strings in 23 lines" statement will eventually appear.

9. (1) The simple method can always press "U" to revert to the original state, (2) use does not store away ": q! "And then re-read the file again;

10. "65G" and then "9yy" after the last line will appear "copy nine lines" such as the words. Press "G" to the last line, and give him "P" to stick nine lines!

11. Because 21~42 22 lines, so "21G" → "22dd" can delete 22 lines, you will find that the cursor is located in the 21 line of the place to the beginning of MANPATH, the number of lines of the notation is deleted.

12. ": W man.test.config", you will find that the last line appears "Man.test.config" [New]. The words.

13. "27G", then give him "15x" can delete 15 characters, the word "you" appears;

14. First "1G" to go to the first line, and then press the uppercase "O" to add a row and in the insertion mode; start input "I am a student ...", press [ESC] back to normal mode for follow-up work;

15. ": Wq"

If your results can be found, then VI use above should not be too big problem! The rest of the problem will be in ... Typing exercises ....

Vim use case

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.