Vim introduces the various functions of VIM in general mode

Source: Internet
Author: User
I. Introduction of VIM
Vim is an upgraded version of VI (Vim config file in/ETC/VIMRC)
Vim is a color-display
Yum Install-y vim-enhanced
General mode, edit mode, command mode

Second, Vim color display and move the cursor
Vim View/etc/passwd file
vim/etc/passwd

passwd File Contents:

Three, the general mode of moving the cursor

Cursor Movement shortcut keys:
Press 5, then L or a space, and the cursor will move 5 characters to the right.
Press 6 and press H, the cursor will move 6 characters to the left
Press 8, then press J, and move the cursor down 8 lines
Press 9, then press K, the cursor moves up 9 lines
Ctrl+f: One graphic a screen to turn down
Ctrl+b: One graphic, one screen upwards
Press 0: The cursor moves quickly to the beginning of the line or shortcut: Shift+6 can also be moved quickly to the beginning of the line
SHIFT+4: Cursor moves quickly to the end of the line
Press two times G; cursor quickly back to the first line
SHIFT+G: Cursor moves quickly to the last line
Press 50 First, then press SHIFT+G: The cursor moves quickly to line 50th

Iv. copy and paste in general mode

Press two times D: delete/cut the row where the cursor is located
Press 5, then two d: delete 5 rows after the cursor row, and delete 5 rows down
P: Paste the copied or pasted content from the line where the cursor is located
Shift+p: Pastes content that has been copied or pasted, starting at the line where the cursor is located
U: Restore previous action (up to 50 restores)
Press two times y: the line where the cursor is copied
Press 3, then two y: Copy 3 lines from the cursor
Ctrl+r: Use U to restore the previous operation accidentally pressed the U, you can press Ctrl+r restore back
X: Remove one character backwards
Press 10 and then x: Remove 10 characters backwards
Shift+x: Delete a character forward
V: Start with the character of the cursor, press V, move the cursor to the specified character, and press X to make the copy. Paste and other operations

Vim introduces the various functions of VIM in general mode

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.