Basic usage of VIM editor

Source: Internet
Author: User

The VIM editor has two modes of operation: Normal mode and edit mode, when the editor is opened, the default is normal mode.
The VIM editor processes data in a memory buffer.
Vim (vi) filename Edit file

Press the I key to enter edit mode, press ESC to exit edit mode and go to normal mode.
In edit mode, press ESC to enter normal mode, then enter: Enter the command line mode, input QW (Q: Exit; w: Save) command to save the file and exit the Vim editor.

In command-line mode:
Q: If the buffer data is not modified, exit
Q! : Cancels all modifications to the buffer data and exits
W FileName: Save the file to another file name
WQ: Save the buffer data to a file and exit

Operations in Normal mode:
H: Move one character to the left
J: Move Down one line
K: Move up one line
G: Move to the last line
Num G: Move to the specified row
GG: Move to First line
X: Delete the character at the current cursor position
DD: Deletes the current cursor in the row
DW: Delete the word at the current cursor location
d$: Deletes the current cursor position to the end of the line
J: Delete line breaks at the end of the line at which the current cursor is located (stitching lines)
U: Undo Previous Edit Command
A: Append data after the current cursor
A: Append data at the end of the current line
Copy and paste (in normal mode):
Y: Copy
YW: Copying words
y$: Copy to end of line
P: Paste
V: Enter visual mode (high brightness displays the text to be copied)

Other popular editors are: Emacs, KDE, Gnome, and more.

Note: This blog post is for individual study notes only

Basic usage of VIM 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.