Re: [Vim-latex-devel] preference for default target
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2003-09-02 22:29:44
|
Hello, On Tue, 2 Sep 2003, Alan Schmitt wrote: > I am very often writing latex documents in collaboration with other > people, who use a Makefile with a target "all" to compile the paper. > I would like to change a preference so that as soon as a Makefile is > present, the default target is "all" (and not ps or dvi). Where can You need to use the g:Tex_MainFileExpression described in the user manual: http://vim-latex.sourceforge.net/documentation/latex-suite/latex-master-file.html In particular, put the following snippet of code in ~/.vim/after/ftplugin/tex/mainfile.vim ---------------------------%<--------------------------- let g:Tex_MainFileExpression = 'MainFile(modifier)' function! MainFile(fmod) " whenever a makefile is present in the file being edited, then set " target to all. This will make pressing \ll result in running " !make all if glob('makefile') != '' TCTarget all endif if glob('*.latexmain') != '' return fnamemodify(glob('*.latexmain'), a:fmod) else return '' endif endfunction ---------------------------%<--------------------------- NOTE: Any location which gets sourced after tex_latexSuite.vim on the filetype event will do. The Tex_MainFileExpression is exec'd whenever latex-suite needs to find out which file needs to be compiled. If you put some code to set the target in it as above, then it will also change the target. HTH Srinath |