Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement imgdir_filename_prefix #61

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jdorel
Copy link

@jdorel jdorel commented Sep 29, 2021

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

Use final_imgdir and final_imgdir_intext to support multiple files
Rework SafeMakeDir to not call any global variables
plugin/mdip.vim Outdated Show resolved Hide resolved
./img/{current_file_name}/
@Wadekiny
Copy link

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>


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants