VIM Command related

Source: Internet
Author: User



In the shell, remember that some of the commonly used VIM commands are more effective when operating.






Cursor movement

h, j, k, l, h # means left, j means down, k means right, l means up
Ctrl f #Previous
Ctrl b #Next page
w, e, W, E # jump to the end of the word, lowercase includes punctuation
b, B #Jump the cursor forward in units of words, lowercase contains punctuation
O #Open a new line
^ #Start of a line
$ #End of a line
gg #First line of the document
[N] G #The Nth or last line of the document
search for

/ pattern #search (non-insert mode)
? pattern #search back
n #cursor reaches the previous target of the search result
N #cursor reaches the next target of the search result
window

: split #Split a window horizontally
: vsplit #Split a window vertically
: close #Close the window
Ctrl W #Switch window, h to the left window, j to the lower window, k to the upper window, l to the right window
Insert mode

i #insert before the cursor
I #insert into the beginning of the line
a #insert behind the cursor
A #Insert to the last position of the line
o, O #New line
Esc #Close insert mode
edit

r #Replace a character under the cursor in insert mode
J #Merge the next line to the previous line
s #Delete a character under the cursor, the cursor is still in the line
S #Delete the line where the cursor is, the cursor is still on the line, different from dd
u #Undo the previous operation
ctrl r #Restore the previous operation
. #Repeat the last command
~ #Convert to uppercase
[N] >> #One line or N lines move one tab to the right
[N] << #One line or N lines move one tab to the left
 

shut down

i #insert before the cursor
I #insert into the beginning of the line
a #insert behind the cursor
A #Insert to the last position of the line
o, O #New line
Esc #Close insert mode
Cut and copy

dd #Delete a line
dw #Delete a word
x # delete the last character
X #Delete the previous character
D #Delete the last character of a line
[N] yy #Copy one line or N lines
yw #Copy a word
p #Paste
Visual mode

v #Select one or more characters
V #Select a line
Excerpt from: https://www.sheetgit.com/sheets/9e58d539d616e9bc68b8d729957ad0dc

 

Vim command related

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.