Common Operations in the Vim Editor

Source: Internet
Author: User

Common Operations in the Vim Editor

Press I to enter the editing mode

Wq! Force save and exit

Q! Do not save, force exit

! Mandatory

Direction key bit:

K

H j l

Ctrl + f move down one page

Ctrl + B move one page up

Starting with a line 0

$ End of a row

The last line of the G File

The first line of the gg File

Dd deletes the row where the cursor is located.

Yy copies the same cursor

P pasted copy content

U rollback ctrl + r forward both are a pair of operations

. Decimal point ".", repeat an operation

[Esc] exit the editing mode, Shift +; enter the command line mode

Ctrl + v block selection, the selected area will be reversed

Y: copy the reversed content.

D. Delete the reversed content.

Multi-file editing

You can add a file name after sp. If you need to open the file, enter the file name. If you only enter sp, the same file will be in two windows.

Ctrl + w + j/k move between windows

Ctrl + w + q exit the current window

The vim setting value is in the/etc/vimrc file, which is not recommended to be modified. Can be modified ~ /. Vimrc (the default does not exist. You can manually create it if necessary)

Vim garbled, as long as it is a coding problem

Echo $ LANG view Encoding

LANG = zh_CN.UTF-8 set encoding

Iconv command can be used to convert language codes

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.