고흥에서 표박사님께 사사받은 vim-latexsuite.

기본적인 설정만 했지만 vi로 TeX작업을 하는데 상당히 강력한 도구가 될 것 같다.

몇 가지 필요한 기본 설정

1. vim-addons 설정 확인
vim-addons status
2. vim-addons에 latexsuite 추가
sudo vim-addons -w install latex-suite
and/or
vim-addons install latex-suite 
sudo로 실행하면 system wide하게 적용된다.

3. 불필요한 에러 메세지 제거
Error detected while processing /var/lib/vim/addons/plugin/remoteOpen.vim:
line   37:
E174: Command already exists: add ! to replace it
line   38:
E174: Command already exists: add ! to replace it
이런 에러가 발생하는 경우가 있는데 저 파일을 열어보면 37, 38째 줄에있는
com -nargs=1 RemoteOpen :call RemoteOpen('<args>')
com -nargs=? RemoteInsert :call RemoteInsert('<args>')  
두 문장을 주석처리 (") 해준다.

4. recommended setting
Make sure that you create a few necessary settings in your ~/.vimrc.
" 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'
In addition, the following settings could go in your ~/.vim/ftplugin/tex.vim file:

" this is mostly a matter of taste. but LaTeX looks good with just a bit
" of indentation.
set sw=2
" TIP: if you write your \label's as \label{fig:something}, then if you
" type in \ref{fig: and press <C-n> you will automatically cycle through
" all the figure labels. Very useful!
set iskeyword+=:

참고링크
http://vim-latex.sourceforge.net/
http://michaelgoerz.net/refcards/#latexsuite

+ Recent posts