Vim compiler common commands

Source: Internet
Author: User

# grep-n Domain main.c--colour=auto

650) this.width=650; "title=" 6631883603326779415.jpg "src=" https://s1.51cto.com/wyfs02/M02/06/97/wKiom1m6doiS_ Zpgaacqh6w8vyg605.jpg-wh_500x0-wm_3-wmp_4-s_910153933.jpg "alt=" Wkiom1m6dois_zpgaacqh6w8vyg605.jpg-wh_50 "/>

# vim MAIN.C +62 open it straight to line 62.

-N Display line number,--colour=auto find the character with color, if recursive find plus R,-NR

#shift +zz Save Exit, (Shift+z is Z, two times Z is also ZZ) there are changes to save first, and: X effect

o Another line under the current line, o another line on the current line, into edit mode

650) this.width=650; "title=" 6631997952536141918.jpg "src=" https://s1.51cto.com/wyfs02/M02/A5/47/ Wkiol1m6dnfqof0uaaakqm2pbxq601.jpg-wh_500x0-wm_3-wmp_4-s_2690776365.jpg "alt=" Wkiol1m6dnfqof0uaaakqm2pbxq601.jpg-wh_50 "/>

: e! discard the changes and then reopen.

#vim MAIN.C

: VSP log.c #水平方向在打开一个log. c window

650) this.width=650; "title=" 6631956171094212324.jpg "src=" https://s5.51cto.com/wyfs02/M00/A5/47/ Wkiol1m6do7bq5lgaahudgw0esg174.jpg-wh_500x0-wm_3-wmp_4-s_1953940498.jpg "alt=" Wkiol1m6do7bq5lgaahudgw0esg174.jpg-wh_50 "/>

CRL+WW Switch window,: Wall Save All windows, Wqall Save exit all windows

Crl+zz (ZZ) Save exit

X is deleted by Byte, U is undo once, U is all undone

V character selection, you can select an area, X is to cut the contents of the area, p paste, Y is to copy the contents of the area, D is deleted.

V is the row, select the line that the cursor passes through

Delete Column

1. Position the cursor where you want to operate.

2.ctrl+v into "visual block" mode, select how many rows this column operates.

3.d deleted.

Insert Column

Knowledge is slightly different when inserting operations. For example, we insert "()" before each line:

1. Position the cursor where you want to operate.

2.ctrl+v into "visual block" mode, select how many rows this column operates.

3.shift+i (i) Enter what you want to insert.

4.ESC Press two times and the inserted content appears in the selected area of each row

650) this.width=650; "title=" 6632001251070947312.jpg "src=" https://s3.51cto.com/wyfs02/M01/06/97/ Wkiom1m6dttj1i0saadir1b38ou879.jpg-wh_500x0-wm_3-wmp_4-s_1029967886.jpg "alt=" Wkiom1m6dttj1i0saadir1b38ou879.jpg-wh_50 "/>

Ctr+v is a block area, the upper and lower left ARROW selects the area.

650) this.width=650; "title=" 6632012246187230578.jpg "src=" Https://s3.51cto.com/wyfs02/M01/A5/47/wKioL1m6dsORss_ Waabxz-zajoo863.jpg-wh_500x0-wm_3-wmp_4-s_2373660541.jpg "alt=" Wkiol1m6dsorss_waabxz-zajoo863.jpg-wh_50 "/>

Set a TAB key 4 spaces, vim. VIMRC

Set ts=4 sw=4

Save, source. vimrc

Bulk Indent v Select the part you want to indent

650) this.width=650; "title=" 6631923185745395573.jpg "src=" https://s4.51cto.com/wyfs02/M02/06/97/ Wkiom1m6dw6dtugdaacmumcm7ww645.jpg-wh_500x0-wm_3-wmp_4-s_3122662484.jpg "alt=" Wkiom1m6dw6dtugdaacmumcm7ww645.jpg-wh_50 "/>

shift+> indent one tab to the right

/word cursor under Search

The word cursor looks above

n Upside down, n up

: Nohls off High brightness

s/old/new/replace new with old, replacing the first match of the current row
s/old/new/g replace new with old, replacing all occurrences of the current row
:%s/old/new/replaces new with old, replacing the first match of all rows
:%s/old/new/g full text Replace specified string
: N1, n2s/old/new/g replace the specified string within a certain range

:%s/old/new/g Replace full-text old with new,g is replace all, C means confirm:%s/word1/word2/c

: Set Bg=dark The color of the annotation is more beautiful

650) this.width=650; "title=" 6632027639350016652.jpg "src=" https://s4.51cto.com/wyfs02/M02/A5/47/ Wkiol1m6dwqb66guaagjjbar2ye995.jpg-wh_500x0-wm_3-wmp_4-s_3424635028.jpg "alt=" Wkiol1m6dwqb66guaagjjbar2ye995.jpg-wh_50 "/>


This article is from the "Linux_woniu" blog, make sure to keep this source http://llu1314.blog.51cto.com/5925801/1965274

Vim compiler common commands

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.