VIM Basic Command

Source: Internet
Author: User

2015-06-04 by Komile
VIM Basic Command

Open a file vim index.php

Description of several modes
Normal Mode
That is, the general Normal mode, the default into Vim, in this mode.
Insert Mode
Insert mode, in fact, refers to the state of editing input. In normal mode, you can press I to enter.
Command-Line
command-line mode, normal mode by the colon (:) into command-line mode, you can enter a variety of commands


General mode
Four directional keys
J: down, K: Up, H: left, L: Right
10J: Move Down 10 rows
10k: Move up 10 rows

0: Start with a line
$: End of line
Shift+g: Jumps to the last line
GG: Jump to the first line
DDP up and down two lines interchange
CTRL +G show current file information
DD: Delete When moving forward
3DD: Cursor row, delete 3 rows down

YYP: Copy a line below the cursor
YyP: Copy to top of cursor

GD, queries the current word and retains it to the current location


In the Insert mode
A: Insert after cursor
o: Insert a row below the cursor line
Shift+o: Inserts a row on the line where the cursor is located
Shift+i cursor to beginning of line edit
I cursor original position edit

Command-line mode
: Wq Save changes and exit
: W save does not exit, generally can be used for debugging
: 40 Move to line 40th
:!pwd View the path to the current file

VIM Basic Command

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.