Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21173
Modified Files:
compiler.vim main.vim texrc
Log Message:
New: An option Tex_ViewRuleComplete_{format} which allows more complete
control for the user to customize the viewer program.
Tex_ViewRule_{format} only worked if the program accepted the file to
be viewed as the last argument.
Suppose you have a latex->html converter which converts a file say
foo.tex to a file foo/index.html. Then you would use:
let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &'
Doing something like this would not be possible using
Tex_ViewRule_html
Index: compiler.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/compiler.vim,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** compiler.vim 17 Jun 2004 03:32:34 -0000 1.69
--- compiler.vim 18 Jun 2004 23:13:22 -0000 1.70
***************
*** 266,279 ****
endif
! if has('win32')
" unfortunately, yap does not allow the specification of an external
" editor from the command line. that would have really helped ensure
" that this particular vim and yap are connected.
! let execString = '!start '.s:viewer.' "'.mainfname.'.'.s:target.'"'
elseif has('macunix')
if strlen(s:viewer)
let s:viewer = '-a '.s:viewer
endif
! let execString = 'silent! !open '.s:viewer.' '.mainfname.'.'.s:target
else
" taken from Dimitri Antoniou's tip on vim.sf.net (tip #225).
--- 266,288 ----
endif
! let _mp = &mp
!
! if Tex_GetVarValue('Tex_ViewRuleComplete_'.s:target) != ''
!
! let &mp = Tex_GetVarValue('Tex_ViewRuleComplete_'.s:target)
! let &mp = substitute(&mp, '{v:servername}', v:servername, 'g')
!
! elseif has('win32')
" unfortunately, yap does not allow the specification of an external
" editor from the command line. that would have really helped ensure
" that this particular vim and yap are connected.
! let &mp = 'start '.s:viewer.' "$*"'
!
elseif has('macunix')
if strlen(s:viewer)
let s:viewer = '-a '.s:viewer
endif
! let &mp = 'open '.s:viewer.' $*.'.s:target
!
else
" taken from Dimitri Antoniou's tip on vim.sf.net (tip #225).
***************
*** 283,306 ****
" because that seems to not work on older bash'es.
if s:target == 'dvi'
if Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 &&
! \ exists('v:servername') &&
\ (s:viewer == "xdvi" || s:viewer == "xdvik")
! let execString = 'silent! !'.s:viewer.' -editor "gvim --servername '.v:servername.
! \ ' --remote-silent +\%l \%f" '.mainfname.'.dvi &'
elseif Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 &&
\ s:viewer == "kdvi"
! let execString = 'silent! !kdvi --unique '.mainfname.'.dvi &'
else
! let execString = 'silent! !'.s:viewer.' '.mainfname.'.dvi &'
endif
! redraw!
else
! let execString = 'silent! !'.s:viewer.' '.mainfname.'.'.s:target.' &'
! redraw!
endif
end
! call Tex_Debug("Tex_ViewLaTeX: execString = ".execString, "comp")
! execute execString
if !has('gui_running')
redraw!
--- 292,327 ----
" because that seems to not work on older bash'es.
if s:target == 'dvi'
+
if Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 &&
! \ v:servername != '' &&
\ (s:viewer == "xdvi" || s:viewer == "xdvik")
!
! let &mp = s:viewer.' -editor "gvim --servername '.v:servername.
! \ ' --remote-silent +\%l \%f" $*.dvi &'
!
elseif Tex_GetVarValue('Tex_UseEditorSettingInDVIViewer') == 1 &&
\ s:viewer == "kdvi"
!
! let &mp = 'kdvi --unique $*.dvi &'
!
else
!
! let &mp = s:viewer.' $*.dvi &'
!
endif
!
else
!
! let &mp = s:viewer.' $*.'.s:target.' &'
!
endif
end
! call Tex_Debug("Tex_ViewLaTeX: makeprg = ".&mp, "comp")
!
! exec 'silent! make! '.mainfname
!
! let &mp = _mp
!
if !has('gui_running')
redraw!
Index: main.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** main.vim 17 Jun 2004 03:32:34 -0000 1.69
--- main.vim 18 Jun 2004 23:13:22 -0000 1.70
***************
*** 606,610 ****
" keep that as a stable point.
function! Tex_Version()
! return "Latex-Suite: version 1.6.04"
endfunction
--- 606,610 ----
" keep that as a stable point.
function! Tex_Version()
! return "Latex-Suite: version 1.6.05"
endfunction
Index: texrc
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texrc,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** texrc 13 Jun 2004 18:12:40 -0000 1.45
--- texrc 18 Jun 2004 23:13:23 -0000 1.46
***************
*** 138,144 ****
" Set your $PATH variable to include the full path to these programs.
if has('win32')
! TexLet g:Tex_ViewRule_ps = 'gsview32'
! TexLet g:Tex_ViewRule_pdf = 'AcroRd32'
! TexLet g:Tex_ViewRule_dvi = 'yap -1'
elseif has('macunix')
" Let the system pick. If you want, you can override the choice here.
--- 138,144 ----
" Set your $PATH variable to include the full path to these programs.
if has('win32')
! TexLet g:Tex_ViewRule_ps = 'gsview32'
! TexLet g:Tex_ViewRule_pdf = 'AcroRd32'
! TexLet g:Tex_ViewRule_dvi = 'yap -1'
elseif has('macunix')
" Let the system pick. If you want, you can override the choice here.
***************
*** 156,159 ****
--- 156,190 ----
TexLet g:Tex_UseEditorSettingInDVIViewer = 0
endif
+
+ " Tex_ViewRuleComplete_{format}
+ "
+ " If a variable like this is specified, then it takes precedence over the
+ " variable with the same suffix defined above. i.e, Tex_ViewRuleComplete_dvi
+ " takes precedence over Tex_ViewRule_dvi.
+ "
+ " If only Tex_ViewRule_{format} is specified, then latex-suite constructs the
+ " actual system command which calls that program automatically. For example,
+ " if you specify Tex_ViewRule_dvi = 'kdvi', then latex-suite will issue the
+ " command
+ " !kdvi --unique file.dvi &
+ "
+ " However, if your viewer program accepts the file to be viewed in a way which
+ " doesn't fit with the way latex-suite constructs the system command, then
+ " specify it using this variable. You can use the same format here which
+ " 'makeprg' accepts. So $* can be used in place of the main file name.
+ "
+ " IMPORTANT: Make sure you make the process go into the background otherwise
+ " vim will wait for the viewer to terminate before letting you edit
+ " the file again.
+ "
+ " Example:
+ " Suppose you have a latex->html converter which converts a file say foo.tex
+ " to a file foo/index.html. Then you would use:
+ "
+ " let g:Tex_ViewRuleComplete_html = 'MozillaFirebird $*/index.html &'
+ "
+ " Doing something like this would not be possible using Tex_ViewRule_html
+ TexLet g:Tex_ViewRuleComplete_dvi = ''
+
" }}}
" ------------------------------------------------------------------------------
|