Some literate programming features for Vim
Plug 'shoumodip/vim-literate'
Export the code blocks in the file into the target file
call literate#export()
Make sure the first line of the file is of the format <!-- vim-literate FILE -->
Edit the code block under the cursor in its own buffer
call literate#source()
Toggle the code block under the cursor from the exporting system
call literate#toggle()
This can also be done manually by prepending the code block with <!-- vim-literate -->
Variable | Description | Default |
---|---|---|
g:literate#file_path |
Export file path | <!-- vim-literate \f\+ --> |
g:literate#block_end |
Code block end | ^```$ |
g:literate#block_start |
Code block start | ^```\w\+ |
g:literate#block_comment |
Code block comment marker | <!-- vim-literate --> |
Variable | Buffer Local |
---|---|
g:literate#file_path |
b:literate_file_path |
g:literate#block_end |
b:literate_block_end |
g:literate#block_start |
b:literate_block_start |
g:literate#block_comment |
b:literate_block_comment |