Linux basic Operations--vi and VIM

Source: Internet
Author: User

text Editing tools under the VI command line
Vim is an enhanced version of VI
command vim to start the Vim editor
vim can typically be used in the form of a vim+ target file path
if the destination file exists, Vim opens the file
If the destination file does not exist, create a new file

VI has three modes: Command mode, insert mode, and ex mode
any mode can go back to command mode with ESC key
Press "i" key in command mode to enter into insert mode, press ESC in insert mode to return to command mode
Press ":" in command mode to enter ex mode, which can be saved, modified, and exited in ex mode
Commands commonly used in command mode are as follows:
I insert text before the cursor
o Insert a new row below the current line
dd Delete entire row
u undo Last Action
yy copy Current line
N+yy First Press 5, followed by YY, is to copy 5 rows of content
p Paste
R replaces the current keyword
/Find Keywords

ex Mode
: W Save current changes
: Q Exit
: q! forced exit
: x Save and exit
: Setr number Displays line numbers
:! Execute a system command and display the results
: SH switch to command line, use Ctrl+d to switch back to vim

Linux basic Operations--vi and VIM

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.