Summary of common Vim commands

Source: Internet
Author: User

Summary of common Vim commands

It's not long to use Vim, but now we can't do without the familiar Vim editing mode. The learning curve of Vim is very steep. At the beginning of learning, it is often discouraged to remember many operation commands.

In fact, as long as you remember some common commands, and insist on using Vim for editing in your work, you will soon be able to be handy.

Cursor Movement)
Command Role (explanation)
h,j,k,l hIndicates to left,jIndicates down,kIndicates to the right,lIndicates going up
Ctrl+f Previous Page
Ctrl+b Next Page
w,e,W,E Jump to the end of a word. lowercase letters include punctuation.
b,B The cursor jumps forward in units of words, with punctuation in lower case
O Open a new row
^ Start of a row
$ End of a row
gg The first line of the document
[N]G The Nth or last line of the document
Insert Mode)
Command Role (explanation)
i Insert to front of the cursor
I Insert to the beginning of a row
a Insert to the end of the cursor
A Insert to the last position of the row
o,O New Line
Esc Disable insert mode
Editing)
Command Role (explanation)
r Replace a character with the cursor in insert mode
J Merge the next row to the previous row
s Deletes a character from the cursor. The cursor is still in the row.
S Delete the row where the cursor is located. The cursor is still in the row, different fromdd
u Undo the previous operation
ctrl+r Restore the previous operation
. Repeat the last command
~ Convert to uppercase
[N]>> One or N rows move a tab to the right
[N]<< Move one or N rows to the left
Disable (Exiting)
Command Role (explanation)
:w Save
:wq,:x Save and close
:q Close (saved)
:q! Force close
Search)
Command Role (explanation)
/pattern Search (non-insert mode)
?pattern Search back
n The cursor arrives at the previous target of the search result.
N The cursor reaches the next target of the search result.
Visual Mode)
Command Role (explanation)
v Select one or more characters
V Select a row
Cut and Paste)
Command Role (explanation)
dd Delete a row
dw Delete a word
x Delete the last character
X Delete the previous character
D Delete the last character of a row
[N]yy Copy one or N rows
yw Copy a word
p Paste
Window operations
Command Role (explanation)
:split Split a window horizontally
:vsplit Vertically split a window
:close Close Window
Ctrl+W Switch window,hTo the left window,jIn the window below,kIn the window above,lTo the right

For more Vim tutorials, see the following:

Build VIM into a simple and practical IDE

Vim Learning Guide

Quick learn Vi Editor

Powerful Vim Editor

Build a Vim Development Environment on CentOS 6.2

Install the highlighted Vim editing tool in CentOS 5.4

Vim tips: C language settings

Set the Vim row number in Ubuntu

Vim editor basic tutorial

This article permanently updates the link address:

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.