Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我当前的项目中,我最终输入了很多此行
Then show me the page
我应该如何创建快捷方式映射,以便如果我在一条线上并点击该快捷方式,则在当前行下方创建一个新行并添加上述行。
如果新添加的行与上述行具有相同的缩进,那就太好了。
我正在使用 MacVim。
在普通模式下,您可以键入或将此行添加到您的 vimrc:
:nmap Q oThen show me the page<cr><esc>
这只是回放击键以o在当前行下方写一个新行(使用正确的缩进),键入字符,按 Enter 换行,然后退出插入模式。
o
我选择了 keystroke Q,但这会覆盖其他内容。您可能会选择不同的击键...
yyp 将复制行 (yy) 并粘贴到行 (p) 下方
yyP 将在当前行 (P) 上方粘贴该行的副本