Use of Vim

Source: Internet
Author: User

Vi:visual Interface

ASCII, Unicode

Three modes: 1, edit mode, command mode, 2, input mode, 3, last line mode

command:# vim [OPTION] ... FILE ...

Edit mode--Input mode

I:insert, enter at the cursor position;

A:append, enter at the back of the cursor position;

O: Opens a new line below the line where the cursor is currently located;

I: Enter at the beginning of the line where the cursor is currently located;

A: Enter at the end of the line at the current cursor;

O: Opens a new line above the line where the cursor is currently located;

Input mode--edit mode ESC

Edit mode--and last-line mode:

Last-line mode-- edit mode ESC


Close file: Wq Save exit: q! Force exit, discard the changes made;


Cursor Jump:

Between characters jump H: Left L: Right J: Next K: Up

jump between Words W: The beginning of the next word e: The ending of the current or next word B: the first word of the current or previous word

Beginning line end Jump 0: Jump to the beginning; $: Jump to the end of the line;


Vim's edit command:

X: Delete the character at the cursor;

#x: Delete the # characters at the beginning of the cursor;

XP: Swap the position of the character where the cursor is located and the character behind it;

R: the character at which the cursor is replaced

D: Delete command

Paste command (p, put, paste):

P: If the buffer is an entire row, the current cursor is pasted below the line, otherwise, it will be pasted at the back of the current cursor;

P: If the buffer is an entire row, the current cursor is pasted above the row, otherwise, it is pasted at the front of the current cursor;

Copy command (y, yank):

Y: Copy, work behaves similar to D command;








This article is from the "Qinnengbuzhuo" blog, make sure to keep this source http://echoroot.blog.51cto.com/11804540/1922573

Use of Vim

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.