~dricottone/vim-markdown-preview

e4b8b9c14ad1a36c7319ecc1487d5ce0e0f41568 — Jamshed Vesuna 7 years ago 5b42c02 + 24b44d5
Merge pull request #27 from letorbi/osx_improvements

OSX improvements
1 files changed, 24 insertions(+), 23 deletions(-)

M plugin/vim-markdown-preview.vim
M plugin/vim-markdown-preview.vim => plugin/vim-markdown-preview.vim +24 -23
@@ 5,8 5,29 @@

let g:vmp_script_path = resolve(expand('<sfile>:p:h'))

let g:vmp_osname = 'Unidentified'

if has('win32') || has('win64')
  " Not yet used
  let g:vmp_osname = 'win32'
elseif has('unix')
  let s:uname = system("uname")

  if has('mac') || has('macunix') || has("gui_macvim") || s:uname == "Darwin\n"
    let g:vmp_osname = 'mac'
    let g:vmp_search_script = g:vmp_script_path . '/applescript/search-for-vmp.scpt'
    let g:vmp_activate_script = g:vmp_script_path . '/applescript/activate-vmp.scpt'
  else
    let g:vmp_osname = 'unix'
  endif
endif

if !exists("g:vim_markdown_preview_browser")
  let g:vim_markdown_preview_browser = 'Google Chrome'
  if g:vmp_osname == 'mac'
    let g:vim_markdown_preview_browser = 'Safari'
  else
    let g:vim_markdown_preview_browser = 'Google Chrome'
  endif
endif

if !exists("g:vim_markdown_preview_temp_file")


@@ 33,26 54,6 @@ if !exists("g:vim_markdown_preview_hotkey")
    let g:vim_markdown_preview_hotkey='<C-p>'
endif


let g:vmp_osname = 'Unidentified'

if has('win32') || has('win64')
  " Not yet used
  let g:vmp_osname = 'win32'
elseif has('unix')
  let s:uname = system("uname")

  if has('mac') || has('macunix') || has("gui_macvim") || s:uname == "Darwin\n"
    let g:vmp_osname = 'mac'
    let g:vmp_search_script = g:vmp_script_path . '/applescript/search-for-vmp.scpt'
    let g:vmp_activate_script = g:vmp_script_path . '/applescript/activate-vmp.scpt'
  else
    let g:vmp_osname = 'unix'
  endif
endif



function! Vim_Markdown_Preview()
  let b:curr_file = expand('%:p')



@@ 90,7 91,7 @@ function! Vim_Markdown_Preview()
        call system('osascript "' . g:vmp_activate_script . '"')
      endif
    else
      call system('open -g /tmp/vim-markdown-preview.html')
      call system('open -a "' . g:vim_markdown_preview_browser . '" -g /tmp/vim-markdown-preview.html')
    endif
  endif



@@ 139,7 140,7 @@ function! Vim_Markdown_Preview_Local()
        call system('osascript "' . g:vmp_activate_script . '"')
      endif
    else
      call system('open -g vim-markdown-preview.html')
      call system('open -a "' . g:vim_markdown_preview_browser . '" -g vim-markdown-preview.html')
    endif
  endif