使用NERDCommenter

时间:2016-08-23 01:02:42

标签: vim pathogen

本教程给出了这个例子:

<leader>c$ |NERDComEOLComment|
Comments the current line from the cursor to the end of line. 

但是在vim中按\c$,c$会复制当前行并切换到插入模式。

我已经通过病原体安装了该插件,:help nerdcommenter确实有效,但:scripts的输出中没有提到nerdcommenter,也不知道是否表示该插件尚未成功安装。

1 个答案:

答案 0 :(得分:1)

看起来很好。以下是一些问题排查提示:

  1. 检查:scriptnames的{​​{1}}输出;它需要在那里。
  2. 检查.../plugin/NERD_commenter.vim
  3. 检查:echo loaded_nerd_comments
  4. 检查:echo g:NERDCreateDefaultMappings
  5. 其他映射是否有效?定义:nmap <Leader>c并按:nmap <Leader>x :echomsg "Works"<CR>
  6. 如果映射不起作用,您可能会意外\x。使用:set paste撤消。