From 3e1e007d588edd7a27b6446264d521589872a328 Mon Sep 17 00:00:00 2001 From: Alexander Paramonov Date: Mon, 10 Feb 2020 13:06:59 +0100 Subject: [PATCH] Allow to view virtual buffers or not saved files --- plugin/vim-markdown-preview.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/vim-markdown-preview.vim b/plugin/vim-markdown-preview.vim index 082c69f..fc385c4 100644 --- a/plugin/vim-markdown-preview.vim +++ b/plugin/vim-markdown-preview.vim @@ -61,6 +61,11 @@ endif function! Vim_Markdown_Preview() let b:curr_file = expand('%:p') + if !filereadable(b:curr_file) + let b:curr_file = "/tmp/vim-markdown-preview.md" + write! /tmp/vim-markdown-preview.md + endif + if g:vim_markdown_preview_github == 1 call system('grip "' . b:curr_file . '" --export /tmp/vim-markdown-preview.html --title vim-markdown-preview.html') elseif g:vim_markdown_preview_perl == 1