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

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.

主站蜘蛛池模板: 梓潼县| 贞丰县| 紫金县| 枝江市| 杂多县| 木兰县| 凤凰县| 美姑县| 陵水| 湖北省| 临颍县| 安康市| 太湖县| 唐河县| 武陟县| 广东省| 沾化县| 隆昌县| 临桂县| 宁海县| 土默特左旗| 明水县| 闵行区| 新乡县| 新乡县| 达日县| 桂阳县| 东乌珠穆沁旗| 桦川县| 凤庆县| 凤凰县| 西乌珠穆沁旗| 清徐县| 沾益县| 闸北区| 洛扎县| 原阳县| 咸阳市| 五河县| 民丰县| 台南县|