Rh134-03 familiar with the VIM editor

Source: Internet
Author: User

Chapter III, familiar with the Vim editor

three modes : command mode , edit mode , last line mode

common commands for Command mode :

Move Cursor W B () {}, G Bottom, GG front

W is a word to move,B is the first word to move

I, I, A, a, O next line edit , o new edit on previous line , S, s

DD cut one line , 2DD

yy copy , 2yy

P Paste p is pasted on the previous line

U cancel last operation, CTRL + R repeats last action

V Visual Mode

Esc

edit mode is I, and insert the contents in front of the cursor

last-line mode : Yes to search

shift+:

W Save

Q Quit without save

Q!

W!

Wq

Setnu

Setnonu

10

/

: Set Nu can see line numbers

:Set Nonu

: one cursor to one number

/s/root/admin found replaced with admin

: 2,7s/:/-2 to 7 rows: Replace with -

:%s/:/-g Entire text replacement


This article from "hcie_38xx" blog, declined reprint!

Rh134-03 familiar with 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.