免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5520 | 回复: 6
打印 上一主题 下一主题

vim 末行模式 如何复制粘贴当前光标处的单词? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-05-21 14:22 |只看该作者 |倒序浏览
如题。在网上找了一下,没有找到,就直接来这里问问大家了,先谢谢哈,呵呵。

论坛徽章:
0
2 [报告]
发表于 2012-05-21 17:56 |只看该作者
回复 1# linux_kejun

看来这个小问题很多人都不会嘛,有知道的请不吝赐教哈,自己顶一个


   

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
3 [报告]
发表于 2012-05-21 21:18 |只看该作者
本帖最后由 ulovko 于 2012-05-21 21:26 编辑

删除:
  1. Deleting Text
  2. Deleting text removes it from the screen and copies it to the buffer. Deleting, like many other commands, can be combined with numeric or symbolic options to make more complex and efficient commands like those seen below.
  3. x - deletes the character under the cursor
  4. X - deletes the character before the cursor
  5. xx - deletes x number of characters starting at the cursor and going forward
  6. xX - deletes x number of characters starting before the cursor and going backward
  7. dw - deletes current word
  8. dd - deletes current line
  9. xdd - deletes x lines
  10. dxw - deletes x words
  11. d0 - deletes from current position to beggining of current line
  12. d$ - deletes from current position to end of line (same as D)
  13. dG - deletes from cursor to the end of the buffer
  14. d1G - deletes from cursor to the beginning of the buffer
  15. ddp - swaps the current line and the line beneath it
复制代码
复制:

  1. yw  yank the selected  word
  2. y$  yank to the end of the line

  3. (字符数目自选,方向自选!)
  4. 1yh
  5. 1yj
  6. 1yk
  7. 1yl
复制代码

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
4 [报告]
发表于 2012-05-21 22:01 |只看该作者
始终没想明白 1个 c 干嘛用的?你肯定不是复制1个吧?

论坛徽章:
0
5 [报告]
发表于 2012-05-23 09:09 |只看该作者
在命令模式下把光标移到要复制单词的第一个字符,然后yw,再把光标移到粘贴处,p就OK了回复 1# linux_kejun


   

论坛徽章:
0
6 [报告]
发表于 2012-05-23 09:27 |只看该作者
回复 5# ganghelloworld
这个我知道呀。我说的是在末行模式(:模式)时复制光标处的单词,不是命令模式。
比如我想搜索光标处的单词,不想手动输入,应该有办法直接复制吧?

   

论坛徽章:
0
7 [报告]
发表于 2012-05-25 10:53 |只看该作者
搜索光标处的单词直接shift+3就可以了。
回复 6# linux_kejun


   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP