开发者

Invoke NERDCommenter in insert mode?

In my .vimrc, I have the following mapping which I use to toggle comments using the excellent NERDCommenter plugin:

vmap <D-/> ,c<space>gv
map <D-/> ,c<space>开发者_StackOverflow

Works great for this TextMate refugee.

However, I'd like it to work in Insert mode as well. Roughly:

  • Use the same combo (command-/)
  • Switch to normal mode
  • Execute the toggle
  • Bonus points for saving the cursor position, I suppose.

My .vimrc skills don't extend to this. Any help?


Use imap to map commands in insert mode. I think the following should work.

imap <D-/> <esc>,c<space>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜