Vim shortcut keys

Source: Internet
Author: User
Tags clear screen

The cursor can be moved in the screen text using the arrow keys, or the H J k L Letter Key
K (upstream) J (downlink) H (shift left) L (shift right)
delete the cursor position character in normal mode, press X
in normal mode, insert or add text:
I insert text before inserting text cursor
A Add text line after add text
: Wq Save changes and exit
: q! Do not save and exit
DW Deletes a word (the cursor is placed in the start out)
d2w Delete Two words
d$ at the end of the current line from the cursor
DD Delete the row
2DD Delete two rows
use the count to make an action:
Enter 2w to move the cursor forward two words
enter 3e to move the cursor forward to the end of a third word
Enter 0 (number 0) to move the cursor to the beginning of the line
Undo Class Command
Enter u to undo the last executed command
Enter u to undo the modification of the entire row
Ctril + R Redo the undone command, that is, undo the Undo command
Place Class command
Enter DD To delete a row so that it will be saved to a register in vim
then move the cursor to another line enter p to paste the previous line above the line
Enter R and a character to replace the character where the cursor is located
C "Number" E starts changing a word from the wrong letter until the end
C $ starts changing a line from the wrong letter until the endGG jumps to the beginning of the file
G jump to end of file
10gg or 10G jumps to line 10th Enter/(or:) characters in normal mode enter the string you want to find in return
n find the string searched for
N reverse lookup of the searched string
If you want to search in reverse order? instead
to go back to the previous position, press CTRL + O to jump to the newer position CTRL + I
enter% in () {} to find pairs of parentheses
Input: S/word1/word2 Enter replaces the first matching string in the row of the cursor
Input: s/word1/word2/g Enter to replace the entire line of the matching string
Enter: #, #s/old/new/g #代表行号 replace the first two lines within the match
input:%s/old/new/g replaces each matched string of the entire file
input:%S/OLD/NEW/GC replaces each matching string of the entire file, and the hint for each string is replacedENTER:! LS Enter to execute external commands within VIM
Enter W Test the command will save the entire file with the test file name (you can! Dir or! ls for verification)! RM TEST to delete it
W jumps to the beginning of the next word
e jumps to the end of the word
B Jump Backwards

to 5th, section III
    Linux terminal commands
 Ctrl + L clear Screen
Ctrl + A moves to the beginning of the command
Ctrl + E moves to the end of the command line
 Cat File Print file contents to directory
cat-n file1 file2 > out stitching file contents and redirecting to the destination file and adding line numbers before the file
 Head-n 1 File1 View the first line of the file
tail-n 1 file1 View the last line of the file
 

Vim shortcut keys

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.