vim你也可以写文本块

function! textobj#dmk#select_a()
  ?```
  let start_pos = getpos('.')
  normal!j
  /```
  let end_pos = getpos('.')
  return ['V', start_pos, end_pos]
endfunction

function! textobj#dmk#select_i()类似,只是注意上下行,
然后,加上

call textobj#user#plugin('markdown', {
\      '-': {
\        'select-a': 'am',  'select-a-function': 'textobj#dmk#select_a',
\        'select-i': 'im',  'select-i-function': 'textobj#dmk#select_i'
\      }
\    })

posted @ 2022-08-07 17:16  zjh6  阅读(14)  评论(0)    收藏  举报  来源