mirror of
https://github.com/tpope/vim-markdown.git
synced 2025-11-08 09:53:50 -05:00
Update [[ and ]] mappings
1. Add support for setext style headings 2. Use the 's' flag in search() to set the ' mark instead of using m' 3. Fix the guard
This commit is contained in:
@@ -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 <silent><buffer> [[ m':call search('^#\{1,5\}\s\+\S', "bW")<CR>
|
||||
nnoremap <silent><buffer> ]] m':call search('^#\{1,5\}\s\+\S', "W")<CR>
|
||||
xnoremap <silent><buffer> [[ m':<C-U>exe "normal! gv"<Bar>call search('^#\{1,5\}\s\+\S', "bW")<CR>
|
||||
xnoremap <silent><buffer> ]] m':<C-U>exe "normal! gv"<Bar>call search('^#\{1,5\}\s\+\S', "W")<CR>
|
||||
if !exists("g:no_plugin_maps") && !exists("g:no_markdown_maps")
|
||||
nnoremap <silent><buffer> [[ :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR>
|
||||
nnoremap <silent><buffer> ]] :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR>
|
||||
xnoremap <silent><buffer> [[ :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR>
|
||||
xnoremap <silent><buffer> ]] :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR>
|
||||
let b:undo_ftplugin .= '|sil! nunmap <buffer> [[|sil! nunmap <buffer> ]]|sil! xunmap <buffer> [[|sil! xunmap <buffer> ]]'
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user