vim - copy a word

Posted My Blog @ cnblogs.com

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vim - copy a word相关的知识,希望对你有一定的参考价值。

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

以上是关于vim - copy a word的主要内容,如果未能解决你的问题,请参考以下文章

用vim从一个文件copy/paste到另一个文件

vim copy / yank而不离开可视模式

在启用 set mouse=a 的情况下复制 Vim 外部的文本

copy的一个vimtutor

vi/vim键盘图

[Shell]vim/vi 高效使用键盘图打印版-vi/vim 使用吸星大法