加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

社区维基:“Vim:yanking机制的高级用法”

发布时间:2020-12-16 01:36:00 所属栏目:安全 来源:网络整理
导读:社区维基 正如yank系统的文档所示(感谢Michal),Vim yank系统似乎比标准剪贴板更复杂.因此,我认为如果vim退伍军人可能向我们展示一些利用这种机制的不同风格,这是有益的.特别是对于复杂项目使用vim而不使用重量级IDE(比方说C?). 原始问题 现在我正在为我输入
社区维基

正如yank系统的文档所示(感谢Michal),Vim yank系统似乎比标准剪贴板更复杂.因此,我认为如果vim退伍军人可能向我们展示一些利用这种机制的不同风格,这是有益的.特别是对于复杂项目使用vim而不使用重量级IDE(比方说C?).

原始问题

现在我正在为我输入的所有内容使用vim,而不仅仅是为了配置服务器,我不想解决以下琐事.我试图制定谷歌搜索查询,但结果没有解决我的问题:D.

问题一:我如何多次猛拉和更换?

一旦我在抽奖历史中有了一些东西(如果这就是它的名字),然后在命令模式中突出显示并使用’p’字符,则替换的文本放在抽奖历史的前面;因此,后续更换操作不会使用我想要的文本.我想这在某些情况下是一个有用的功能,但我在我的工作流程中并不需要它.

问题二:如何在不导致线条向前波动的情况下键入文本?

我使用硬标签以某种方式对我的代码进行分配 – 例如,

FunctionNameX     ( lala * land               );
FunctionNameProto (                           );

当我弄清楚需要进入第二个函数的内容时,如何在不移动文本的情况下插入它?

问题三有没有办法在同一台机器上的gvim实例上有统一的抽奖历史?我有> 1台显示器.只是想知道,我正在使用高亮鼠标中键点击.

答案一:来自Vim文档的相关(如果不是特别令人鼓舞的话)qoute(参见:help put-Visual-mode):

When using a put command like |p| or |P| in Visual mode,Vim will try to
replace the selected text with the contents of the register. Whether this
works well depends on the type of selection and the type of the text in the
register. With blockwise selection it also depends on the size of the block
and whether the corners are on an existing character. (Implementation detail:
it actually works by first putting the register after the selection and then
deleting the selection.)
The previously selected text is put in the unnamed register. If you want to
put the same text into a Visual selection several times you need to use
another register. E.g.,yank the text to copy,Visually select the text to
replace and use “0p . You can repeat this as many times as you like,the
unnamed register will be changed each time.

答案二:R(大写’R’)让你进入替换模式.

我很想回答三,我很害怕.

答案三:不完全匹配“统一抽搐历史”规范,但是如果剪贴板可用,则“y yanks to clipboard”和p pastes from clipboard.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读