VI and Vim Text editor principles, parameters and shortcut keys

Source: Internet
Author: User
VI belongs to the Linux kernel built-in command (vi editor)
1. Vi/vim Working principle
Before you learn Vi/vim editor parameters and shortcut keys, you need to understand how Vi/vim works first. The Vi/vim command has three modes: edit mode, view mode, command mode, and different modes to execute different commands.

2, VIM based on the VI development of the editor, and the VI command consistent
I: Insert (enter edit mode)
ESC key: Exit edit mode to enter view mode or exit Command mode to enter view mode
"Shift+:": Entering command mode from view mode
View mode operation The following command, edit mode no
U: Undo (If you don't want to delete the row you just deleted, you can cancel the delete operation)
X: Delete
V: Select text
Y: Copy
YY: Copy when moving forward
DD: Delete cursor in the row
P: Paste
/: Search Down
? : Search up (using the search command/or? After pressing the N key to continue the next search)
GG: Cursor moves to the first line of the file
G: Cursor moves to the last line of the file
0: Move the cursor to the beginning of the line
SHIFT+4: Moves the cursor to the end of the line

Operation in command mode
: W Save
: Wq Save Exit
: q! Do not save/force exit
: w! Force write, the original file is not allowed to write the state of the column, such as a read-only file, the command can be forced to write, if the user is the owner of the file, the Superuser is not subject to this restriction.
: Set Nu (mber) Displays line number "Set Nonu cancel line number"

VI and Vim Text editor principles, parameters and shortcut keys

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.