Friday, November 6, 2009

How to integrate Vim nad LaTex?

1. Download the latest update of vim-latex package from this location.

2. Extract it into your ./~vim directory

waldekd@waldekd-laptop:~/.vim$ tar zxf ../Desktop/vim-latex-1.5-20091002-r1074.tar.gz ./

3. Copy contents of the direction on appropriate level

waldekd@waldekd-laptop:~/.vim$ cp -r vim-latex-1.5-20091002-r1074/* ./

4. Open your vim's configuration file

waldekd@waldekd-laptop:~/Documents/Latex$ gvim /etc/vim/gvimrc

and add below text to it

REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on

" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash

" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*

" OPTIONAL: This enables automatic indentation as you type.
filetype indent on

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'

5. Test your vim by open any .tex file

waldekd@waldekd-laptop:~/Documents/Latex$ gvim /home/waldekd/Documents/Latex/dyd.tex

6. Make fun :)

No comments:

Search This Blog