Vim Editor Detailed

Source: Internet
Author: User
Tags exit in

Vim is a file editor, pure ASCII code, is full screen editor and mode editor

Vim mode

Edit mode

Last-line mode

Input mode

Vim Mode Conversion

Edit mode-->> Input mode

I: Indicates the input mode in front of the character of the current cursor

A: Indicates that the character after the current cursor is converted into input mode

O: Indicates that a row is inserted below the current cursor and into the input mode

I: Indicates that the line at the beginning of the current cursor is converted into input mode

A: Indicates the end of the line at the current cursor is converted into input mode

O: Indicates that a row is inserted above the current cursor and converted into input mode

Input mode-->> edit mode

Esc

Edit mode-->> last line mode

Required Input: Colon

: 10d, delete line tenth

: 1,10d Delete lines 1th through 10th

: Set Nu Sets line number

:! Ls/etc can execute shell commands

Last-line mode-->> edit mode

ESC key

Input mode cannot be converted directly to the last line mode

First, open the file

Vim/path/to/file

Vim +#: Open the file and locate it on line #

Vim +: Open file positioned on last line

Vim +/pattern: Open the file and navigate to the beginning of the line that was first matched to the pattern

Second, close the file

1. Close the file in the last line mode

: W means save

: Q indicates that exit is not saved

: Wq means save and exit

:!q means not saving and exiting

: w! means forced save, only administrators have this permission

: X means save exit, equivalent to: Wq

2. Exit in edit mode

ZZ means save exit

Third, move the cursor

H: Means to move one character to the left, #h表示向左移动 # characters

J: means move down one line, #j表示向下移动 # line

K: means move up one line, #k表示向上移动 # line

L: means move one character to the right, #l表示向右移动 # characters

This article is from the "ignorance of knowledge" blog, please be sure to keep this source http://yujiqing.blog.51cto.com/1475974/1619290

Vim Editor Detailed

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.