Vim Common commands

Source: Internet
Author: User
Tags exit in

Content from https://www.cnblogs.com/chenlogin/p/6245958.html
I picked a few that I think are most commonly used, as follows:

Default to Normal mode (ESC enters this mode in any mode)
I: Enter input mode
: Enter Command mode

: Q exit
: Wq Save and exit
: W Save

Exit in edit mode
ZZ Save and exit

Use Vim to edit multiple files
: Next switches to the next file
:p Rev Switch to the previous file
: Last switch to final file
: first to switch to file one
: Q Exits the current file
: QA All exits

Copy and paste rows
U undo
UU recovery
Yy|2yy Copying rows
DD|2DD Delete, cut lines
P Paste to next line
P Paste to previous line

The following content is from http://www.linuxidc.com/Linux/2012-08/69363.htm
Form split close Form
: Close closes the current form
: Only close all other forms

: Split Horizontal split
: Vsplit Vertical Split
:d iffsplit xxx to split the window and file xxx do compare (diff)
Ctrl-w p jumps to the previous split window (in two split windows to switch back)

Open the specified file (two.c) with split window ": Split two.c"
Create new file in Split form ": New"

Write it first, then add it later.

Vim Common commands

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.