VIM Common directives

Source: Internet
Author: User

0 indicates the beginning of a line, and $ indicates the end

G moves to the end of the line, Ng moves to n rows, GG moves to the beginning

[ENTER] jumps to the next line of the current cursor

/word down looking for word this word

Word looks up word this word

N repeats the previous find operation

N reverse, repeat previous find operation up

: N1,n2s/word1/word2/g replaces word1 with N1 line to N2 between rows Word2

: N1,N2S/WORD1/WORD2/GC provides a choice of whether to replace each match or skip it, etc.

: 1, $s/word1/word2/g replace from first line to last line

X,x Delete a character from the current row

Nx

DD Delete When moving forward

Ndd

D1G Delete all rows up

DG drops all rows down

D0 character that deletes the position of the current line at the beginning of the cursor

d$ Delete the position of the current line cursor to the end of the line character

YY copy when moving forward

Nyy

y1g

YG

Y0

y$

P,p paste on the next line or row of the cursor

In general mode, press V to become the visual mode, you can copy and paste the selected block

: W

: w!

: Q

: q! Forced rollout does not save

: Wq

If ZZ changes, save and leave, or go straight away.

: w [filename] Save As

: R [FileName] adds additional file reading to the line following the cursor

: N1,n2 W[filename] N1 to N2 content Save As

:! command to jump out of some instructions

: Set Nu

: Set Nonu

VIM Common directives

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.