[Tuglist] Expanding \input{files}

Manoj K N tuglist@tug.org.in
Thu, 30 May 2002 11:32:08 +0530


Hello,

This trick is for users of vim only.

Instead of making a separate file as suggested below, one can do this.

Put the following lines, and more, as you would like, in a file ~/.tex.vim

cmap mkd :w<CR> :!latex %<CR>
cmap mkp :w<CR> :!pdflatex %<CR>

Add the following line in ~/.vimrc

autocmd BufNewFile,BufRead *.tex so <sfile>:h/.tex.vim

Then starting vim with 

$vim foobar.tex

suffices. I would prefer to name the first file .tex.vim; if one names it
*.tex, whenever one opens it in vim to edit, it will be sourced,
unnecessarily. 

With regards,
Manoj.

On Sat, Apr 13, 2002 at 12:44:35PM -0000, Asokan  K wrote:
 
> If easier switching between files is what desired,
> 
> the following script may be usefull with "vi editor"
> ++++++++++++++++++++++++++++++++++++
> set nocompatible
> set autowrite
> set ruler
> set laststatus=2
> set filetype=tex
> syntax on
> set tw=75
> map<F2> <Esc>:w<CR>
> map <F3> <Esc> w:<CR> :!latex run.tex <CR>
> "map <F3> <Esc>:!latex run.tex && dvips run.dvi -o
> run.ps <CR>
> map <F4> <Esc>:split run.log <CR>
> map <F5> <Esc>:!xdvi run.dvi 2>dvi.log & <CR>
> map <F6> <Esc>:!gv run.ps 2>ps.log & <CR>
> map <F9> <Esc>:n <CR>
> map <F10> <Esc>:N <CR>
> ++++++++++++++++++++++++++++++++++++++++++
> save this in a file ,say vimtex.
> Put all the tex files along with the above file in a
> directory. The name of the master file is 'run.tex'
> 
> start vim with
> $vim *.tex -u vimtex



-- 
Manoj K N,
Texas Instruments India Limited, 
Diamond District, Airport Road, 
Bangalore. PIN: 560037. Karnataka. India.

Ph: +91-80-5099894

12 Deg 58 Min N, 77 Deg 39 Min E