将寄存器名称发送到映射命令
我使此命令将我当前的缓冲区的文件路径发送到+
寄存器:
:nmap <Leader>yp :let @+=expand("%:p")<cr>
我想将其扩展到它,以便用户选择呼叫&lt; leader&gt; yp时要发送的寄存器
,但我不确定如何。
如果有一种“捕获所选寄存器”的方法,我可以将其使用到我的命令中,然后允许“ a&lt; leade&gt; yp
之类的东西? 谢谢!
I made this command to send my current buffer's file path into the +
register:
:nmap <Leader>yp :let @+=expand("%:p")<cr>
I'd like to extend it so that the user choose the register to send to when calling <Leader>yp
, but I'm not sure how.
If there's a way to "capture the selected register", can I use it into my command to then allow something like "a<Leader>yp
?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
多亏了Romainl的评论,我才能得出这个解决方案:
Thanks to romainl comment, I came to this solution: