Changed s:CreateMenuItems() to the shorter s:CreateMaps().

This commit is contained in:
Benji Fisher
2011-12-06 11:33:56 -05:00
parent 0bb5f7e889
commit 68cfa2f3c5

View File

@@ -2751,7 +2751,7 @@ inoremap <silent> <plug>NERDCommenterInInsert <SPACE><BS><ESC>:call NERDComment(
" Create menu items for the specified modes. If a:combo is not empty, then " Create menu items for the specified modes. If a:combo is not empty, then
" also define mappings and show a:combo in the menu items. " also define mappings and show a:combo in the menu items.
function! s:CreateMenuItems(modes, target, desc, combo) function! s:CreateMaps(modes, target, desc, combo)
let menuRoot = get(['', 'comment', '&comment', '&Plugin.&comment'], let menuRoot = get(['', 'comment', '&comment', '&Plugin.&comment'],
\ g:NERDMenuMode, '') \ g:NERDMenuMode, '')
let leader = escape(exists('mapleader') ? mapleader : '\', '\') let leader = escape(exists('mapleader') ? mapleader : '\', '\')
@@ -2771,22 +2771,22 @@ function! s:CreateMenuItems(modes, target, desc, combo)
endif endif
endfor endfor
endfunction endfunction
call s:CreateMenuItems('nv', 'NERDCommenterComment', 'Comment', 'cc') call s:CreateMaps('nv', 'NERDCommenterComment', 'Comment', 'cc')
call s:CreateMenuItems('nv', 'NERDCommenterToggle', 'Toggle', 'c<space>') call s:CreateMaps('nv', 'NERDCommenterToggle', 'Toggle', 'c<space>')
call s:CreateMenuItems('nv', 'NERDCommenterMinimal', 'Minimal', 'cm') call s:CreateMaps('nv', 'NERDCommenterMinimal', 'Minimal', 'cm')
call s:CreateMenuItems('nv', 'NERDCommenterNest', 'Nested', 'cn') call s:CreateMaps('nv', 'NERDCommenterNest', 'Nested', 'cn')
call s:CreateMenuItems('n', 'NERDCommenterToEOL', 'To EOL', 'c$') call s:CreateMaps('n', 'NERDCommenterToEOL', 'To EOL', 'c$')
call s:CreateMenuItems('nv', 'NERDCommenterInvert', 'Invert', 'ci') call s:CreateMaps('nv', 'NERDCommenterInvert', 'Invert', 'ci')
call s:CreateMenuItems('nv', 'NERDCommenterSexy', 'Sexy', 'cs') call s:CreateMaps('nv', 'NERDCommenterSexy', 'Sexy', 'cs')
call s:CreateMenuItems('nv', 'NERDCommenterYank', 'Yank then comment', 'cy') call s:CreateMaps('nv', 'NERDCommenterYank', 'Yank then comment', 'cy')
call s:CreateMenuItems('n', 'NERDCommenterAppend', 'Append', 'cA') call s:CreateMaps('n', 'NERDCommenterAppend', 'Append', 'cA')
call s:CreateMenuItems('', ':', '-Sep-', '') call s:CreateMaps('', ':', '-Sep-', '')
call s:CreateMenuItems('nv', 'NERDCommenterAlignLeft', 'Left aligned', 'cl') call s:CreateMaps('nv', 'NERDCommenterAlignLeft', 'Left aligned', 'cl')
call s:CreateMenuItems('nv', 'NERDCommenterAlignBoth', 'Left and right aligned', 'cb') call s:CreateMaps('nv', 'NERDCommenterAlignBoth', 'Left and right aligned', 'cb')
call s:CreateMenuItems('', ':', '-Sep2-', '') call s:CreateMaps('', ':', '-Sep2-', '')
call s:CreateMenuItems('nv', 'NERDCommenterUncomment', 'Uncomment', 'cu') call s:CreateMaps('nv', 'NERDCommenterUncomment', 'Uncomment', 'cu')
call s:CreateMenuItems('n', 'NERDCommenterAltDelims', 'Switch Delimiters', 'ca') call s:CreateMaps('n', 'NERDCommenterAltDelims', 'Switch Delimiters', 'ca')
call s:CreateMenuItems('i', 'NERDCommenterInInsert', 'Insert Comment Here', '') call s:CreateMaps('i', 'NERDCommenterInInsert', 'Insert Comment Here', '')
call s:CreateMenuItems('', ':', '-Sep3-', '') call s:CreateMaps('', ':', '-Sep3-', '')
call s:CreateMenuItems('', ':help NERDCommenterContents<CR>', 'Help', '') call s:CreateMaps('', ':help NERDCommenterContents<CR>', 'Help', '')
" vim: set foldmethod=marker : " vim: set foldmethod=marker :