Use of the VIM editor

Source: Internet
Author: User
Tags gtk

One, when the Vim is not installed, prompt installation

[Email protected]:~/test$ VIM ABC
The program ' Vim ' is already included in the following packages:
* VIM
* Vim-gnome
* Vim-tiny
* Vim-athena
* Vim-athena-py2
* Vim-gnome-py2
* VIM-GTK
* Vim-gtk-py2
* VIM-GTK3
* Vim-gtk3-py2
* Vim-nox
* Vim-nox-py2
Please try: sudo apt install < selected packages >

Second, vim common instructions


Cat ABC//OPEN ABC file
VIM Editor has three modes, command mode, input mode, low line mode
just opened the file is the command mode,
Press "I" to enter input mode
Press "ESC" to enter low-line mode (also command mode)

VIM + ABC//Open ABC file cursor directly to the last line
VIM +3 ABC
VIM +10000 ABC
VIM +/search ABC//Open ABC file, cursor directly to the first "search" hit position, press ' n ' to toggle the cursor position

vim AA bb cc//Opens AA bb cc file together, if not then create the file
enter in low-line mode: next/:n,:p rev/:n

low-line mode common directives:
: w
: Q
: Wq
:!//Mandatory
: 6//cursor positioned on line 6th
/xxx//Cursor position backward search XXX
? XXX//Cursor stop position search forward xxx

h cursor moves left
J down
K on
L Right

Ctrl + F PAGE DOWN (front)
Ctrl + B page Up (back)
Ctrl + D turn down half page (down)
Ctrl + U Upside down Half page (UP)


Command mode common directives:
DD Delete the line where the cursor is located
o Insert a row below the cursor line and switch to input mode
yy copy cursor is located in the row below paste
p paste below the line where the cursor is located
P paste (uppercase) above the line where the cursor is located

Use of the 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.