LINUX Study Notes 2-file programming

Source: Internet
Author: User
A) vi is the first full-screen interactive editor in linux. B ). Vi has three working modes: command line mode, insert mode, and bottom line mode. c) basic functions: 1. go to edit: vihello. c2. Type I to enter the insert mode. 3. type [ESC] to return to command line mode 4...

 

A) vi is the first full-screen interactive editor in linux.

 

B ). Vi has three working modes: command line mode, insert mode, and bottom line mode.

 

C) basic functions:

 

1. go to edit: vi hello. c

 

2. Type I to enter the insert mode.

 

3. type [ESC] to return to the command line mode.

 

4. type: Enter the baseline mode.

 

5. type: wq save and exit

 

D) function keys in command line mode:

 

1. • yy: Copy the row where the current cursor is located

 

2. • [n] yy: n is a number. copy the n rows starting with the current cursor.

 

3. • p: Paste the copied content to the next line where the cursor is located

 

4. • dd: delete the row where the current cursor is located

 

5. • [n] dd: delete n rows starting with the row where the current cursor is located

 

6. •/name: find the string named "name" after the cursor

 

7. • G: Move the cursor to the end of the file (uppercase)

 

8. • u: cancel the previous action (in lower case)

 

E) base row mode function keys:

 

1. •: w save

 

2. • q exits vi (the system will prompt to save the changes)

 

3. •: q! Force exit (do not save changes)

 

4. •: wq is saved and then exited.

 

5. •: w [filename] Save the file as filename

 

6. •: set nu displays the row number

 

7. •: set nonu cancel row number

From the column of Ainemo

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.