vim - copy/paste a word

本文介绍了在Vim编辑器中如何快速复制和删除光标所在位置的单词。通过使用yw命令来复制单词,以及使用x命令来删除单词,提高了文本编辑效率。如果光标不在单词开头,可以使用byw命令进行相应操作。

1. http://stackoverflow.com/questions/7797068/copying-a-word-and-pasting-over-a-word

viwp - visually select a word, and paste over it by something in the clip.

2. How to copy/delete word under cursor in Vim
http://www.littletechtips.com/2011/05/how-to-copydelete-word-under-cursor-in.html

Assuming the cursor is at the first character of the word in command mode:
yw (y for yank and w for word)

Other ways of doing the same thing which are not as efficient:
vey (v starts visual mode. e tells vim to move to end of word. y yanks or copies the word. to delete replace y with x.)

if the cursor is somewhere in the middle of the word, add a "b" (before) the command:
byw / bvey

转载于:https://www.cnblogs.com/cnblogist/p/6125352.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值