Vim Text Editor

Source: Internet
Author: User

Three different modes

Command mode (edit mode): The default mode after opening the editor, you can move the cursor, delete and so on.

^: Jump to the first non-whitespace character at the beginning of a line

$: Jump to end of line

GG: Jump directly to the first line

#G: Jump To Line #

X: Delete a single character at the cursor location

#x: Remove # Characters

DD: Delete the entire line of the cursor

#dd: Delete the line that contains the cursor.

U: Undo Last Action

Ctrl+r: Undo the previous undo operation

Paste operation

If the entire row is deleted

P: Paste below the line where the cursor is currently located

P: Paste Above

If the deletion is not an entire row

P: Paste at the location of the current cursor

P: Paste in front

Copy operation

Yy:

#yy:


Insert mode : Insert, inserting. You can enter it.


exit mode (not in line mode): powerful. To operate as input commands.


In the non-row mode, save the file, named 1.txt.

: W/tmp/1.txt

: 1,7d Delete 1-7 rows

: 1, $d delete the first line to the last row

:., +3. Indicates the current cursor row, +3 means the following 3 rows

% indicates full text

$ represents the last line


Options:

-O: Multiple files are opened at the same time, multiple files are placed horizontally.

Vim Text Editor

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.