]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add <Plug> mappings & option for default mappings
authorhaya14busa <hayabusa1419@gmail.com>
Mon, 31 Mar 2014 06:19:57 +0000 (15:19 +0900)
committerhaya14busa <hayabusa1419@gmail.com>
Mon, 31 Mar 2014 06:19:57 +0000 (15:19 +0900)
ftplugin/mkd.vim

index 4e9f4485833154119dc021d18e836dc4b243a020..0627cc525f2f307ecf9bf31ab532ed85b98a526d 100644 (file)
@@ -308,11 +308,29 @@ function! s:MapNormVis(rhs,lhs)
     execute 'vn <buffer><silent> ' . a:rhs . ' <esc>:call <sid>VisMove(''' . a:lhs . ''')<cr>'
 endfunction
 
-call <sid>MapNormVis(']]', 'b:Markdown_MoveToNextHeader')
-call <sid>MapNormVis('[[', 'b:Markdown_MoveToPreviousHeader')
-call <sid>MapNormVis('][', 'b:Markdown_MoveToNextSiblingHeader')
-call <sid>MapNormVis('[]', 'b:Markdown_MoveToPreviousSiblingHeader')
+
+call <sid>MapNormVis('<Plug>(Markdown_MoveToNextHeader)', 'b:Markdown_MoveToNextHeader')
+call <sid>MapNormVis('<Plug>(Markdown_MoveToPreviousHeader)', 'b:Markdown_MoveToPreviousHeader')
+call <sid>MapNormVis('<Plug>(Markdown_MoveToNextSiblingHeader)', 'b:Markdown_MoveToNextSiblingHeader')
+call <sid>MapNormVis('<Plug>(Markdown_MoveToPreviousSiblingHeader)', 'b:Markdown_MoveToPreviousSiblingHeader')
 " Menmonic: Up
-call <sid>MapNormVis(']u', 'b:Markdown_MoveToParentHeader')
+call <sid>MapNormVis('<Plug>(Markdown_MoveToParentHeader)', 'b:Markdown_MoveToParentHeader')
 " Menmonic: Current
-call <sid>MapNormVis(']c', 'b:Markdown_MoveToCurHeader')
+call <sid>MapNormVis('<Plug>(Markdown_MoveToCurHeader)', 'b:Markdown_MoveToCurHeader')
+
+if ! exists('g:markdown_no_default_key_mappings')
+\ || !g:markdown_no_default_key_mappings
+    nmap ]] <Plug>(Markdown_MoveToNextHeader)
+    nmap [[ <Plug>(Markdown_MoveToPreviousHeader)
+    nmap ][ <Plug>(Markdown_MoveToNextSiblingHeader)
+    nmap [] <Plug>(Markdown_MoveToPreviousSiblingHeader)
+    nmap ]u <Plug>(Markdown_MoveToParentHeader)
+    nmap ]c <Plug>(Markdown_MoveToCurHeader)
+
+    vmap ]] <Plug>(Markdown_MoveToNextHeader)
+    vmap [[ <Plug>(Markdown_MoveToPreviousHeader)
+    vmap ][ <Plug>(Markdown_MoveToNextSiblingHeader)
+    vmap [] <Plug>(Markdown_MoveToPreviousSiblingHeader)
+    vmap ]u <Plug>(Markdown_MoveToParentHeader)
+    vmap ]c <Plug>(Markdown_MoveToCurHeader)
+endif