mirror of
https://github.com/tpope/vim-markdown.git
synced 2025-11-08 09:53:50 -05:00
Add [[ and ]] maps
Hat tip to Joe Reynolds for the idea.
This commit is contained in:
@@ -19,6 +19,14 @@ 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>
|
||||
let b:undo_ftplugin .= '|sil! nunmap <buffer> [[|sil! nunmap <buffer> ]]|sil! xunmap <buffer> [[|sil! xunmap <buffer> ]]'
|
||||
endif
|
||||
|
||||
function! s:NotCodeBlock(lnum) abort
|
||||
return synIDattr(synID(v:lnum, 1, 1), 'name') !=# 'markdownCode'
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user