img-paste-devs/img-paste.vim

Custom path doesn't work in Ubuntu20.4 / Vim 8.1.2269

Opened this issue · 2 comments

I add these in vimrc

let g:mdip_imgname = 'test'
 
function SavePic()
    let pp = expand('%:t:r')
    let g:mdip_imgdir = pp
endfunction

autocmd BufEnter *.md call SavePic()

and it worked in windows.

Now I use it in Ubuntu 20.4, it can save the picture in the custom path, but in the markdown file, it inputs a default name and default path text.


After "leader"p, If I just press "Enter", it shows:

![Image](img/test_2020-07-26-22-22-42.png)

If I type "asdf", it shows:

![Image](img/asdf.png)

Which means, these setting in Windows, it worked. But in Ubuntu, it didn't.

And in Ubuntu, it's saving function is OK. But the input text, it didn't work.


I think may be the problem is in the mdip.vim, the Linux part?

I'm try my hard to read the mdip.vim file, but it's difficult to me...

Hmm, what was the point in modified global variable? Is this related to #16?

that's a pretty nice idea to have the images saved on a specific folder for each file.

I found these variables a bit confusing.

If what you want is to have the markdown link point to the correct location from mdip_imgdir, then adding let g:mdip_imgdir_intext = g:mdip_imgdir should solve your problem.

function SavePic()
    let pp = expand('%:t:r')
    let g:mdip_imgdir = pp
    let g:mdip_imgdir_intext = g:mdip_imgdir
endfunction