Vim Learning Summary

Source: Internet
Author: User

two modes of vim

Command mode
Edit mode

Command function
Esc Exit edit mode
cursor Command
Command function
H J k L Lower left top right
: 33 Move cursor to line 33rd
33G Move cursor to line 33rd
Gg The cursor moves to the first line of the file (g means go)
G Cursor moves to end of file line
W The cursor moves forward one word
B Move the cursor backward one word
Ctrl+u Scroll up half screen
Crtl+d Scroll down half screen
Ctrl+e Scroll up one line
Ctrl+y Scroll down one line
Ctrl+f Scroll up one full screen
Ctrl+b Scroll down one full screen
Edit Command
Command function
I Insert before cursor
I Beginning of insertion
O Another line of input
A Insert after cursor
A End of line insertion
R Replace
copy, paste, delete, Undo, Redo
Command function
Y Copy when moving forward
: 3, 9 Co 12 After the contents of line 3rd through 9th are copied to 12 rows
P Paste before cursor
P Paste after cursor
X Delete the character after the cursor
X Delete cursor before character
Dd Delete the current row, which is actually cut, which is added to the buffer and can be pasted using the Paste command
Ndd Delete the current line and its subsequent n-1 rows
d$ Delete cursor current to end of line
Dw Delete a word
V Visual mode
U Undo
CTRL + R Redo
Search Command
Command function
/pattern Search Backwards for pattern
? pattern Search for pattern forward
: Set ignorecase Ignore Case Lookup
: Set Noignorecase Case-sensitive Exact match
Fx Finds the current line next to a character X
% To match a parenthesis for the purpose of the move
Save, Exit
Command function
Zz Save and exit
: W Save
: Q Exit
: q! Discard all forced exits
: Wq Save and exit
other
Command function
: Set Nu Set Display line numbers

Vim Learning Summary

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.