diff --git a/autoload/latex.vim b/autoload/latex.vim index cf0a4c7..30bb6ed 100644 --- a/autoload/latex.vim +++ b/autoload/latex.vim @@ -113,6 +113,7 @@ function! s:init_environment() " {{{1 " call latex#util#set_default('g:latex#data', []) call latex#util#set_default('b:latex', {}) + call latex#util#set_vim_executable() " " Set some file type specific vim options diff --git a/autoload/latex/latexmk.vim b/autoload/latex/latexmk.vim index 8b3389c..4bc0bdd 100644 --- a/autoload/latex/latexmk.vim +++ b/autoload/latex/latexmk.vim @@ -324,8 +324,9 @@ function! s:latexmk_set_cmd(data) " {{{1 if g:latex_latexmk_continuous let cmd .= ' -pvc' if g:latex_latexmk_callback && has('clientserver') - let callback = 'vim --servername ' . v:servername - \ . ' --remote-expr \"latex\#latexmk\#errors(0)\"' + let callback = g:latex_vim_executable + let callback .= ' --servername ' . v:servername + let callback .= ' --remote-expr \"latex\#latexmk\#errors(0)\"' if has('win32') let cmd .= ' -e "$success_cmd .= ''' . callback . '''"' \ . ' -e "$failure_cmd .= ''' . callback . '''"' diff --git a/autoload/latex/util.vim b/autoload/latex/util.vim index 62cca53..0e83b9f 100644 --- a/autoload/latex/util.vim +++ b/autoload/latex/util.vim @@ -341,6 +341,16 @@ function! latex#util#set_default(variable, default) " {{{1 endif endfunction +function! latex#util#set_vim_executable() " {{{1 + if exists('g:latex_vim_executable') | return | endif + + if exists('mac') + let g:latex_vim_executable = 'mvim' + else + let g:latex_vim_executable = 'vim' + endif +endfunction + function! latex#util#tex2tree(str) " {{{1 let tree = [] let i1 = 0