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

  • Mastering Vim
  • Ruslan Osipov
  • 148字
  • 2021-06-10 18:51:32

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.

主站蜘蛛池模板: 永吉县| 石阡县| 革吉县| 漾濞| 广河县| 延庆县| 册亨县| 武穴市| 乌拉特中旗| 铜鼓县| 汝南县| 武平县| 镇江市| 大石桥市| 策勒县| 龙山县| 竹北市| 东光县| 资阳市| 五原县| 泰兴市| 蕲春县| 潼南县| 巴彦淖尔市| 惠东县| 隆昌县| 佛学| 将乐县| 许昌市| 松潘县| 广安市| 信丰县| 金秀| 仪征市| 娄底市| 衡山县| 霍邱县| 游戏| 华阴市| 台湾省| 开阳县|