是否存在vim或gVim命令来复制括号中的文本?
发布时间:2020-12-15 22:27:35 所属栏目:安全 来源:网络整理
导读:在下面的代码片段中,如果我转到第一个打开的括号(以(spit)开头的行 (defn missing-accts "Prints accounts found in one report but not the other." [report-header mapped-data out-file] (spit out-file (str "nn " (count mapped-data) " " report-hea
在下面的代码片段中,如果我转到第一个打开的括号(以(spit)开头的行
(defn missing-accts "Prints accounts found in one report but not the other." [report-header mapped-data out-file] (spit out-file (str "nn " (count mapped-data) " " report-header "nn") :append true) . . . vim突出显示第一个(和结束)括号. 有没有,如果有的话,什么是vim命令会抽出整个spit命令? 谢谢. 解决方法
Vim确实有这样的命令,幸运的是它非常简单.输入y%.
这有效的原因是%是Vim称之为移动命令的.它从一个分隔符移动到匹配的分隔符 – 在您的情况下从左括号到结束分隔符.如果调用为yy,y命令会将一行拉入Vim的缓冲区,但不需要第二行.相反,人们可以发出像%这样的动作,于是Vim会将移动的文本拉出来.因此,y%. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |