Is it possible to make lexima continue a bullet list?
Closed this issue · 2 comments
eight04 commented
I tried something like:
call lexima#add_rule({'char': '<CR>', 'at': '\v^\s*\*\s+.*', 'input': '<CR>* ' })
It does work partially but if I try matching the cursor:
call lexima#add_rule({'char': '<CR>', 'at': '\v^\s*\*\s+.*\%#', 'input': '<CR>* ' })
It no longer works.
cohama commented
\v
can not be used with \%#
because it means literary %#
sequence matching but not cursor matching.
How about this.
call lexima#add_rule(#{char: '<CR>', at: '^\s*\*\s\+.*\%#', input: '<CR>* ' })
eight04 commented
👍
I tried mapping it to bullets.vim plugin (https://github.com/dkarter/bullets.vim/blob/746f92ae05cdcc988857d8e76418326f07af9494/plugin/bullets.vim#L1008C16-L1008C16)
call lexima#add_rule(#{char: '<CR>', at: '^\s*\*\s\+.*\%#', input: '<C-r>=BulletNewLine()<CR>' })
function! BulletNewLine()
execute "normal \<Plug>(bullets-newline)"
return ''
endfunction
Unfortunately, it seems there are some conflicts with cursor positioning so the cursor always ends with *|
instead of * |
.