Changes

Jump to navigation Jump to search
573 bytes added ,  01:49, 3 August 2005
Makefile example moved here from another page (contribution by Buggs)
* some essential math support
* proper URL highlighting ('%' doesn't start a comment, ...) [request by VnPenguin]
* perhaps borrow something from http://vim-latex.sourceforge.net/?
== Other useful vim plugins ==
* spell-checker: http://www.vim.org/scripts/script.php?script_id=499, but native spell-checking support will be included in Vim 7
== LaTeX plugins ==
 
perhaps it would be possible to borrow anything from them:
 
http://vim-latex.sourceforge.net/
 
 
=== MetaPost extension ===
 
Should highlight the syntax between <tt>btex/verbatimtex</tt> ... <tt>etex</tt> as TeX.
 
This doesn't work 100% (problems with commands inside comments): If anyone knows how to repair that, please do so. It would be nice if this would have landed in the official metapost syntax highlighting script for vim one day.
 
unlet b:current_syntax
syn include @texTop syntax/tex.vim
" MetaPost has TeX inserts for typeset labels
" verbatimtex, btex, and etex will be treated as keywords
syn match mpTeXbegin "\(verbatimtex\|btex\)"
syn match mpTeXend "etex"
syn region mpTeXinsert start="\(verbatimtex\|btex\)"hs=e+1 end="etex"he=s-1 \
contains=@texTop,mpTeXbegin,mpTeXend containedin=ALL keepend
== Powerful key mappings ==
* two types of mappings: stand-alone and changing the previous word
* usage of mappings that change the previous word: type the name of the macro and ,ta (for tag, use your leader character instead of the comma); it created \start-\stop block of the macro
* put the code into <code>.vim/after/plugin/context.vim</code>
<pre>
let maplocalleader = mapleader
imap <buffer> <LocalLeader>' \quote{}<Left>
</pre>
 
 
== Makefile ==
 
For your ConTeXt document, you can prepare a Makefile like this one (Contributed by [[User:Buggs|Buggs]]):
 
# An example Makefile to compile a context file, paper.tex
paper.pdf: paper.tex
texexec paper
test:
xpdf paper.pdf
clean:
rm *.bbl *.dvi *.aux *.log *.blg
 
If you put these mappings to your <code>.vimrc</code> file, you can than compile the document with F9 and preview it with F8:
 
" map ":make" to the F9 key
imap <F9> <ESC>:make<CR>
nmap <F9> :make<CR>
"map ":make test" to the F8 key
imap <F8> <ESC>:make test<CR>
nmap <F8> :make test<CR>
 
 
=== MetaPost extension ===
 
Should highlight the syntax between <code>btex/verbatimtex</code> ... <code>etex</code> as TeX.
 
This doesn't work 100% (problems with commands inside comments): If anyone knows how to repair that, please do so. It would be nice if this would have landed in the official metapost syntax highlighting script for vim one day.
 
unlet b:current_syntax
syn include @texTop syntax/tex.vim
" MetaPost has TeX inserts for typeset labels
" verbatimtex, btex, and etex will be treated as keywords
syn match mpTeXbegin "\(verbatimtex\|btex\)"
syn match mpTeXend "etex"
syn region mpTeXinsert start="\(verbatimtex\|btex\)"hs=e+1 end="etex"he=s-1 \
contains=@texTop,mpTeXbegin,mpTeXend containedin=ALL keepend

Navigation menu