dots/.vim/ftplugin/pandoc/anki.vim

23 lines
615 B
VimL
Raw Permalink Normal View History

2022-08-16 15:23:18 +02:00
" Anki helper functions
" Convert cloze note to regular text
"
" * `AnkiRemoveAllClozes` all cloze notes in file
" * `AnkiRemoveSelectedClozes` all clozes in selected range
"
" E.g.
"
" ```markdown
" START
" Cloze
" In this sentence {{c1::this word}} was closed.
" END
" ```
"
" ```markdown
" In this sentence this word was closed.
" ```
2022-09-24 12:31:16 +02:00
au FileType pandoc com! -range AnkiRemoveAllClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
2022-08-16 15:23:18 +02:00
au FileType pandoc com! -range AnkiRemoveSelectedClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge