From: haya14busa Date: Mon, 31 Mar 2014 06:19:57 +0000 (+0900) Subject: Add mappings & option for default mappings X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/8c609c8af79d81b34cb139c44017e6d881696d85?ds=inline;hp=-c Add mappings & option for default mappings --- 8c609c8af79d81b34cb139c44017e6d881696d85 diff --git a/ftplugin/mkd.vim b/ftplugin/mkd.vim index 4e9f448..0627cc5 100644 --- a/ftplugin/mkd.vim +++ b/ftplugin/mkd.vim @@ -308,11 +308,29 @@ function! s:MapNormVis(rhs,lhs) execute 'vn ' . a:rhs . ' :call VisMove(''' . a:lhs . ''')' endfunction -call MapNormVis(']]', 'b:Markdown_MoveToNextHeader') -call MapNormVis('[[', 'b:Markdown_MoveToPreviousHeader') -call MapNormVis('][', 'b:Markdown_MoveToNextSiblingHeader') -call MapNormVis('[]', 'b:Markdown_MoveToPreviousSiblingHeader') + +call MapNormVis('(Markdown_MoveToNextHeader)', 'b:Markdown_MoveToNextHeader') +call MapNormVis('(Markdown_MoveToPreviousHeader)', 'b:Markdown_MoveToPreviousHeader') +call MapNormVis('(Markdown_MoveToNextSiblingHeader)', 'b:Markdown_MoveToNextSiblingHeader') +call MapNormVis('(Markdown_MoveToPreviousSiblingHeader)', 'b:Markdown_MoveToPreviousSiblingHeader') " Menmonic: Up -call MapNormVis(']u', 'b:Markdown_MoveToParentHeader') +call MapNormVis('(Markdown_MoveToParentHeader)', 'b:Markdown_MoveToParentHeader') " Menmonic: Current -call MapNormVis(']c', 'b:Markdown_MoveToCurHeader') +call MapNormVis('(Markdown_MoveToCurHeader)', 'b:Markdown_MoveToCurHeader') + +if ! exists('g:markdown_no_default_key_mappings') +\ || !g:markdown_no_default_key_mappings + nmap ]] (Markdown_MoveToNextHeader) + nmap [[ (Markdown_MoveToPreviousHeader) + nmap ][ (Markdown_MoveToNextSiblingHeader) + nmap [] (Markdown_MoveToPreviousSiblingHeader) + nmap ]u (Markdown_MoveToParentHeader) + nmap ]c (Markdown_MoveToCurHeader) + + vmap ]] (Markdown_MoveToNextHeader) + vmap [[ (Markdown_MoveToPreviousHeader) + vmap ][ (Markdown_MoveToNextSiblingHeader) + vmap [] (Markdown_MoveToPreviousSiblingHeader) + vmap ]u (Markdown_MoveToParentHeader) + vmap ]c (Markdown_MoveToCurHeader) +endif