Vim basic functions, modes, commands

Source: Internet
Author: User
Vim basic functions, modes, and commands 1. vim functions 1. run vim to start the vim editor. 2. generally, we use the vim + target file path to use vim3. if the target file exists, vim will open the file 4. if the target file does not exist, vim creates and opens the file. vim mode 1. i... vim basic functions, modes, and commands 1. vim functions 1. run vim to start the vim editor. 2. generally, we use the vim + target file path to use vim3. if the target file exists, vim will open the file 4. if the target file does not exist, vim creates and opens the file. vim mode 1. general mode, edit mode, command line mode 2. the general mode and the edit mode and command line mode can be switched to each other, but the edit mode and command line mode cannot be switched to each other. III. in normal mode, run the command 1. I to insert text before the cursor. if you want to insert text, move the cursor there and press I to insert a new line under the current line 2.o 3. dd deletes the entire row. 4. yy put the content of the current row into the buffer (copy the current row) 5. n + yy put the content of n rows into the buffer (copy n rows) 6. p put the buffer text behind the cursor (paste) 7. u undo the previous operation 8. r replaces the current character (press r first and then press the target character) 9. /search for keywords (the keywords are highlighted and switched back and forth by n directly) 4. command line mode 1.: w save the current modification 2.: q exit 3: q! Force exit 4.: x save and exit, equivalent to wq 5.: set number (set nu) display row number 6 .:! System Command to execute a system command and display the result 7. switch sh to the command line
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.