~dricottone/vim-markdown-preview

48f4444f951b4d5a4f2c0fd6647752bd7fe02eb9 — Jamshed Vesuna 9 years ago ecf29f3
Don't remove temporary files, and removed the time delay
2 files changed, 4 insertions(+), 4 deletions(-)

M README.md
M plugin/vim-markdown-preview.vim
M README.md => README.md +1 -1
@@ 31,4 31,4 @@ Behind The Scenes
=================
1. First, vim-markdown-preview renders your markdown as html and creates a temporary file `vim-markdown-preview.html` in `/tmp/`.
2. Next, vim-markdown-preview then either opens the html file or refreshes the Google Chrome tab.
3. Lastly, vim-markdown-preview removes the temporary file so nothing left behind.
3. If you would like vim-markdown-preview to remove the temporary file so nothing left behind, uncomment lines 20 and 21.

M plugin/vim-markdown-preview.vim => plugin/vim-markdown-preview.vim +3 -3
@@ 8,7 8,7 @@ function! Vim_Markdown_Preview()
  call system('markdown ' . curr_file . ' > /tmp/vim-markdown-preview.html')
  let chrome_wid = system("xdotool search --name 'vim-markdown-preview.html - Google Chrome'")
  if !chrome_wid
    sleep 300m
    "sleep 300m
    call system('see /tmp/vim-markdown-preview.html & > /dev/null &')
  else
    let curr_wid = system('xdotool getwindowfocus')


@@ 17,8 17,8 @@ function! Vim_Markdown_Preview()
    call system("xdotool key 'ctrl+r'")
    call system('xdotool windowactivate ' . curr_wid)
  endif
  sleep 700m
  call system('rm /tmp/vim-markdown-preview.html')
  "sleep 700m
  "call system('rm /tmp/vim-markdown-preview.html')
endfunction

autocmd Filetype markdown,md map <buffer> <C-p> :call Vim_Markdown_Preview()<CR>