【问题标题】:Mapping to comment out multiple lines with a motion in IdeaVim?映射以在 IdeaVim 中用动作注释掉多行?
【发布时间】:2019-07-22 21:58:49
【问题描述】:

我正在尝试在 IdeaVim 中重新创建一些 https://github.com/tpope/vim-commentary 函数。

我在.ideavimrc 中尝试了各种映射,例如:

nnoremap gcc :action CommentByLineComment<CR>

这很好,但我不能用2gcc 注释掉两行。或ngcc 注释掉n 行。

我也试过像这样映射它们:

nnoremap 2gcc Vj:action CommentByLineComment<CR><Esc>
nnoremap 3gcc V2j:action CommentByLineComment<CR><Esc>
" etc...

像这样:

nnoremap gc2j V2j:action CommentByLineComment<CR><Esc>
nnoremap gc3c V3j:action CommentByLineComment<CR><Esc>
" etc...

但它们不起作用。

关于如何实现这一点的任何帮助?

【问题讨论】:

    标签: ideavim


    【解决方案1】:

    Ideavim update 0.52, 2019-07-23 带来了对emulation of the vim-commentary plugin 的支持。
    可以通过将此行输入.ideavimrc来启用它:

    set commentary
    

    【讨论】:

      【解决方案2】:

      IdeaVim 似乎包含许多阻止正确执行此类映射的错误。随意创建问题here

      评论扩展的功能目前正在审核中。您可以跟踪它的状态here。您可以加入Early Access Program 以尽快接收更新。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-03-10
        • 2015-08-20
        • 2015-11-18
        • 2021-07-10
        • 1970-01-01
        • 1970-01-01
        • 2013-09-10
        • 1970-01-01
        相关资源
        最近更新 更多