diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index d2d1e17..ba8526c 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -19,11 +19,11 @@ else let b:undo_ftplugin = "setl cms< com< fo< flp<" endif -if !exists("g:no_plugin_maps") || !exists("g:no_markdown_maps") - nnoremap [[ m':call search('^#\{1,5\}\s\+\S', "bW") - nnoremap ]] m':call search('^#\{1,5\}\s\+\S', "W") - xnoremap [[ m':exe "normal! gv"call search('^#\{1,5\}\s\+\S', "bW") - xnoremap ]] m':exe "normal! gv"call search('^#\{1,5\}\s\+\S', "W") +if !exists("g:no_plugin_maps") && !exists("g:no_markdown_maps") + nnoremap [[ :call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW") + nnoremap ]] :call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW") + xnoremap [[ :exe "normal! gv"call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW") + xnoremap ]] :exe "normal! gv"call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW") let b:undo_ftplugin .= '|sil! nunmap [[|sil! nunmap ]]|sil! xunmap [[|sil! xunmap ]]' endif