Vim Editor Detailed

Source: Internet
Author: User
Tags exit in mul

One, VIM editor:

Text editor, word processor. Getting Started editor (nano,sed)

VI Editor: (Visual Interface)

Vim Editor: (VI improved) Enhanced Edition

Second, VIM mode:

1. Turn on vim default to edit mode (Command mode): All mechanical commands are understood as editing the entire document, such as adding, deleting rows.

2. Input mode: Tap the keyboard action as input to the contents of the file, save to the file.

3. Last-line mode: enter many commands. Must be entered from edit mode.

Three, Mode conversion:

1. Edit-Enter:

I: In front of the current cursor character, convert to input mode;

A: After the current cursor character, convert to input mode;

O: Under the current cursor character, create a new line, convert to input mode;

I: At the beginning of the current cursor character, converted to input mode;

A: At the end of the line at the current cursor character, convert to input mode;

O: At the top of the current cursor character, create a new line and convert to input mode;

2. Input-Edit:

Esc:

3. Edit-Last line:

: Wait for input command

4. Last line-edit:

Esc:

Iv. Methods of Use:

1. Open the file:

#vim/path/to/somefile If the file exists, it opens, and the new file does not exist.

Vim +12/etc/fstab Open the file so that the cursor is in line 12.

Vim +/etc/fstab Open the file so that the cursor is in the last line.

Vim +/mul/etc/inittab Open the file so that the cursor is in the Mul line.

2. Close the file:

(1) Closing the file in the last line mode:

: Q Do not save exit

: Wq Save and exit

: q! Forced exit

: w! Save, Force Save

: Wq can be abbreviated to X

: wq! Forcibly save exit

(2) Exit in edit mode:

ZZ

3. Move the cursor:

(1) Character movement

H; left

L: Right

J: Next

K: Up

#h: Moving a # character

(2) Move in Word units

W: Move the next word first

E: Transfer to current or next tail

B: Tune to the current or next word header

(3) in-line jump

O: Absolute Beginning

^: first non-empty character at beginning of line

$: absolute end of line

4, (between the lines to jump)

G: Last line

V: Flip Screen:

CTRL+F: Flip one screen down

Ctrl+b: Turn up one screen

Ctrl+d: Flip Down half screen

Ctrl+u: Flip up half screen

Six: Delete a single character:

X: Delete a single character at the cursor location

#x: # Characters after deletion of the cursor

Seven: Delete command

DD: Delete the line containing the cursor


This article is from the "blog of the Night" blog, please be sure to keep this source http://cqtangbo.blog.51cto.com/2978612/1594637

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.