官术网_书友最值得收藏!

Copying and pasting with registers

You can copy text by using the y (yank) command, followed by a movement or a text object. You can also hit y from a visual mode when you have selected some text.

In addition to all of the standard movement, you can use   yy  to yank the contents of the current line.

Let's yank the following piece of code by typing ye (yank until the end of the word):

This will copy animal_kind into our default register. Now, place the cursor where you want the text to appear (the text is inserted after the cursor):

To paste the code, hit p:

The delete and change operators also yanks content so that you can paste it later. Oh, and you can prefix the paste command with a number, in case you ever want to duplicate something multiple times.

主站蜘蛛池模板: 东方市| 鄂伦春自治旗| 普安县| 涡阳县| 赤峰市| 邵东县| 南漳县| 孙吴县| 郁南县| 巴彦淖尔市| 城市| 扎鲁特旗| 壤塘县| 固安县| 盐山县| 平山县| 华阴市| 若尔盖县| 濮阳县| 介休市| 雷波县| 龙岩市| 新蔡县| 象山县| 孝义市| 清远市| 梁河县| 霞浦县| 乐山市| 清涧县| 阿拉善右旗| 琼结县| 西乌| 永平县| 镇原县| 昭苏县| 铜川市| 临海市| 大姚县| 茂名市| 宁都县|