vimwiki icon indicating copy to clipboard operation
vimwiki copied to clipboard

Ignore markdown for specific pages or large sections?

Open token47 opened this issue 3 years ago • 3 comments

I feel like this has been asked already but cannot find the answer, so sorry in advance if it is the case.

I'm using vimwiki mostly as a repository of code snippets and small procedures with commands to copy/paste. While it's very nice to use markdown on a few pages (including the index), it's very cumbersome to be enclosing everything else in triple quotes just to get vimwiki not swallowing characters that I need to be on the text when copying with the mouse.

Basically 90% of my pages are composed of code or commands examples, and therefore triple quotes on the first and last lines to have everything ignored. Is there a way to avoid this? Or at least to make it more elegant? I'm ok with embedding something on the bottom of page to give the hint, or name the files using some pattern, maybe flagging it as a TXT file somewhere on the referencing page.

My current configs are:

let g:vimwiki_list = [{'path': '~/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}]
let g:vimwiki_global_ext = 0

Thank you!

token47 avatar Jun 17 '22 22:06 token47

Humm I just had the crazyest idea of including the .txt extension to the file name in the link, and seems like vimwiki understands it, keeps the extension and then vim will not interpret anything.

Still would like to hear other ideas if anyone has any.

Thanks

False alarm: it still interprets markdown even with the txt extension on the file.

token47 avatar Jun 17 '22 22:06 token47

Maybe an autocommand in .vimrc could help. Disable vimwiki and default and only enable with an autocommand if the file path is matching (or include) the vimwiki folder.

thingsiplay avatar Jul 13 '22 18:07 thingsiplay

See :help vimwiki-nohtml.

The trick may be that any given Markdown implementation is unlikely to respect this directive, but it could probably be built into whatever customwiki2html.sh equivalent pretty easily.

brennen avatar Jul 19 '22 03:07 brennen