Open jdorel opened 3 years ago
When opening vim, the .vimrc
file will be run once, and g:mdip_imgdir
will only be set once.
But opening a new buffer in vim doesn't reset g:mdip_imgdir
, so g:mdip_imgdir
remains unchanged, causing this problem. My solution is this:
add codes in .vimrc
function! MdPasteImage()
let g:mdip_imgdir_intext = './md_images_' . expand('%:r')
let g:mdip_imgdir = './md_images_' . expand('%:r')
"echo g:mdip_imgdir
"echo g:mdip_imgdir_intext
call mdip#MarkdownClipboardImage()
endfunction
autocmd FileType markdown nmap <buffer><silent> <leader>p :call MdPasteImage()<CR>
Use final_imgdir and final_imgdir_intext to support multiple files Rework SafeMakeDir to not call any global variables
Fix #50 not working when editing multiple files