Linux Learning Notes--vi and VIM editor

Source: Internet
Author: User
Tags switches

The vi Editor full name is Visual Interface, which is a visual interface, like Notepad in Windows, Vim is equivalent to an upgraded version of VI, which contains all the operations commands of VI, and what vim does with respect to VI:

1, VIM support multi-level revocation

2. Vim can be run across platforms

3. Vim support Syntax highlighting

4. Vim supports graphical interface

Mode of operation of the VIM editor:

Command mode, input mode, bottom line mode (can also be categorized into command mode)

Vim Common commands:

VIM ABC: Open ABC file, if not created

VIM + ABC: After entering the ABC file, the cursor is positioned to the last line, the first line is the default

VIM+3 ABC: Position the cursor to the third line after entering the ABC file

Vim +/admin ABC: After entering the ABC file, quickly navigate to the first page of the file where the admin word appears.

Vim AA bb cc: Create or open multiple files at once, by default entering into the first AA file, using the bottom line mode input in the AA file: N can switch to the next file, enter: N or: prev can switch to the previous file

Bottom-line mode common commands:

: W Save current file

: Q Exits the current file

:! Force exit of the current file

: LS lists all open files

: n switches to the latter file

: N switches to the previous file

: 15 cursor quickly navigates to 15 rows

/xxx the first occurrence of the XXX string from the cursor position to search backwards

? XXX starts searching forward from the cursor position the first time a XXX string appears

Command mode common commands:

H Cursor Shift Left

J Cursor Move Down

K Move Cursor up

L MOVE the cursor right

DD deletes the cursor in the row

o Insert a row below the line where the cursor is located and switch to input mode

YY the copy cursor is in the row

P (lowercase) paste below the line where the cursor is located

P (uppercase) is pasted above the line where the cursor is located

Linux Learning Notes--vi and 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.