Linux Basics (6)--vim Editor uses--rhel6.5__linux

Source: Internet
Author: User

1. Character Operation

I insert

I Insert at the beginning of the line

A Line End Insert

X Delete one character after

X Delete one character after

U undo One Step

2. Line Operation

The home or ^ key moves to the beginning of the line

End key or $ move to End-of-line

NDD Delete n row, also cut n row

P Paste

3. V Mode

Ctrl + V enters v mode, can be batch commented

Enter the V-mode cursor Select n line, press I input #, the ESC key exits and completes the comment.

Enter v mode, select N row, press D to cancel N line comment

4. Replace

The first this occurrence of each row is changed to that

:%s/this/that/

All occurrences of this in the file are changed to that

:%s/this/that/g

Replace each 2~5 in the line

: 2,5 s/this/that/g #注意是s不是%s

5. Miscellaneous

To invoke system commands within a file:

:!ifconfig #即感叹号 + command

: Set Nu #加行号

: Set Nonu #取消行号

: Noh #取消高亮

GG navigates to the beginning of the line

G positioning to end of line

: N positioned to DIN line

: R a.txt #读其他文件到本文件

6. Customizing Vim

Mainly used in writing scripts or other development, the following simple example

Can be used in/ETC/VIMRC files so that all users are in effect

Can be in the user's home directory:

Vim/vimrc

Set Nu

Set history=10000

....

7. Gedit

In addition to Vim can also use gedit

Run gedit can start gedit, graphical operation can be.

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.