diff --git a/plugin/nerdcommenter.vim b/plugin/nerdcommenter.vim index 33eba31..c4c4497 100644 --- a/plugin/nerdcommenter.vim +++ b/plugin/nerdcommenter.vim @@ -78,6 +78,7 @@ function! s:CreateMaps(modes, target, desc, combo) endif endfor endfunction + call s:CreateMaps('nx', 'Comment', 'Comment', 'cc') call s:CreateMaps('nx', 'Toggle', 'Toggle', 'c') call s:CreateMaps('nx', 'Minimal', 'Minimal', 'cm') @@ -97,6 +98,15 @@ call s:CreateMaps('i', 'Insert', 'Insert Comment Here', '') call s:CreateMaps('', ':', '-Sep3-', '') call s:CreateMaps('', ':help NERDCommenterContents', 'Help', '') +" Shim functions so old code gets passed through to the autoload functions +function! NERDComment(mode, type) + return nerdcommenter#Comment(a:mode, a:type) +endfunction + +function! NERDCommentIsLineCommented(lineNo) + return nerdcommenter#IsLineCommented(a:lineNo) +endfunction + inoremap NERDCommenterInsert :call nerdcommenter#Comment('i', "insert") " switch to/from alternative delimiters (does not use wrapper function)