vim yank 命令

本文详细介绍了vim编辑器中如何使用vimyank命令进行高效的内容复制与删除操作。通过简单的步骤展示如何标记文本起点,到达终点后进行内容的复制或删除,并将其粘贴到所需位置。适用于希望提高vim编辑效率的用户。
<?xml version="1.0" encoding="utf-8"?> vim yank 命令

vim yank 命令

1 vi 标识着我年轻

那是我年轻时候,深深地着迷于vi的速度。

那时候觉得太酷了。所以每当用起vi,就能想到那段坚苦光辉的岁月。

2 vi yank

# 复制一个区域的内容
:81, 109y

If you ever need to cut/copy/delete/paste lines without knowing the actual number of lines, here is what you should do.

In normal mode, go to the beginning of the section that you want to yank.

Type mk to mark this spot as k.

Go to the end of the section you want to yank using whatever movement commands you like. Type: y'k (<y-yank>, <single quote-go to mark>, k) To yank from the mark to the current location.

You can paste those lines wherever you want with p.

Similarly, d'k will cut/delete the lines from the current location to the mark.

2.1 复制一段内容示例如下:

# 1. 移动起始位置,做好标记
mk

# 2. 移动到终点位置,复制标记到此点间的内容
y'k

# 3. 移动到将要粘贴的位置
p

2.2 删除一段内容示例如下:

# 1. 移动起始位置,做好标记
mk

# 2. 移动到终点位置,删除标记到此点间的内容
d'k


Date: 2013-03-20 Wed

Author: liweilijie

Org version 7.9.2 with Emacs version 23

Validate XHTML 1.0

转载于:https://www.cnblogs.com/liweilijie/archive/2013/03/20/2971679.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值