Changes

Jump to navigation Jump to search
6,474 bytes added ,  08:57, 29 September 2006
removed spam
Nice site! <a href= [[Related Programs]] | [[Text editor]] > http://governmentgrantwww.vim.theaporg/ This page will be about editing ConTeXt source in (g)vim.info  == Filetype detection ==Tex (plain tex), latex and context all use <code>government grant.tex</code> extension for files which makes it difficult to detect the filetype based on the extension. From Vim 7 onwards, vim does some intelligent checking to see it the file is plaintex or latex or context. If the first line of a*.tex file has the form %&<format> <a hrefthen this determined the file type: plaintex (for plain TeX), context (forConTeXt), or tex (for LaTeX). Otherwise, the file is searched for keywords tochoose context or tex. If no keywords are found, it defaults to plaintex.You can change the default by defining the variable g:tex_flavor to the format(not the file type) you use most. Use one of these: let g:tex_flavor = "plain" let g:tex_flavor = http"context" let g:tex_flavor = "latex"Currently no other formats are recognized. * If you use ConTeXt most of the time, but occasionally use latex or plaintex, you can add the following to your <code>.vimrc<//grantnataliecode> let g:tex_flavor = "context"* If you only use ConTeXt, you can add the following lines to filetype.theapvim: " ConTeXt augroup filetypedetect au! BufRead,BufNewFile *.info tex setfiletype context augroup ENDso the next time you open a <code>grant natalie*.tex</acode> <file, vim will recognise always recognize it as a hrefcontext file.   == ftplugin and syntax file ==  Nikolai Weibull was the first one who wrote context.vim files and submitted them to the official vim cvs repository.They are part of the official Vim 7.  If you are using an older Vim, you can download the files at:* [http://grantpellcvs.sourceforge.net/viewcvs.theappy/vim/vim7/runtime/syntax/context.info >grant pell<vim runtime/syntax/a> <a href= context.vim] - syntax highlighting* [http://collegegrantcvs.sourceforge.theapnet/viewcvs.info py/vim/vim7/runtime/ftplugin/context.vim runtime/ftplugin/context.vim] - filetype specific behaviour (like repeating comments at the beginning of line)  It's mostly up to you which syntax highlighting scheme you prefer. <code>college grantcontext.vim</code> is alighter version than <code> tex.vim<a href= http://albumamygrantcode>.theapIt knows some ConTeXt details that are not implemented in <code>tex.info vim</code>album amy grant, while math and some other TeX features are not supported yet in </acode> context.vim<a href= http://businessgrantsmallcode>.theap.info  <b>business grant smallIf you feel that something is missing, please contribute!</ab> < === TODO === * extract data from texweb and create syntax highlighting definitions for ConTeXt* add metafun macros (from metafun manual)* enable metapost/metafun, JavaScript and XML inside ConTeXt* some essential math support* proper URL highlighting ('%' doesn't start a href= comment, ...) [request by VnPenguin]* perhaps borrow something from http://paydayloanvim-latex.theapsourceforge.info >payday loan<net/?* Have a> <a hrefbetter filetype detection for *.tex files, to distinguish between plain tex, latex and context files (can this be deleted now? --[[User:Adityam|Aditya]])* vim auto-complete for vim == Other useful vim plugins ==  * autocomplete: http://homeequityloanvim.theapsourceforge.info >home equity loan<net/scripts/a> <a hrefscript.php?script_id= 182, almost undocumented, but life-saving* spell-checker: http://autoloanwww.theapvim.info >auto loan<org/scripts/a> <a hrefscript.php?script_id=499, but native spell-checking support will be included in Vim 7 == using latex-suite ==  [http://personalloanvim-latex.sourceforge.theapnet/ latex-suite] currently doesn't support ConTeXt, but if you use it, here's what you have to do to compile ConTeXt documents: 1.info After downloading and installing latex-suite, locate the file "texrc" (usually located in <code>personal loan~/.vim/ftplugin/latex-suite</acode> ). Copy this file to <a href= http:code>~/.vim/ftplugin/tex/studentloan.theap.info >student loantexrc</acode> < 2. Open this copy in your favorite editor (vim comes to mind...) 3. After line 80 in this file, there is a hrefseries of "Compiler rules." Just add this line to the section:  TexLet g:Tex_CompileRule_cont = http'texexec --pdf --nonstopmode $*' This will add compilation for ConTeXT. In order to use it://studentloanconsolidation 4.theapWhen you're in vim normal mode, run this command:  TGTarget cont [that's "colon TGTarger cont"]  5.info Edit your TeX-files, save the changes; when you want to compile, switch to normal mode and just type <code>student loan consolidation\ll</acode> <(that's '' 'backslash el el' '') Voila, compilation should start. You'll have to specify this compiler target every timeI you open a hrefTeX-file in Vim. If you want to make this the default compiler, you should have this line in your texrc:  TexLet g:Tex_DefaultTargetFormat = 'cont'  == Powerful key mappings == http a set of buffer-local insert-mode macros to speed up ConTeXt source editing (by [[User://homeloanDavid antos|D.theapA.info >home loan]] 19:52, 8 Jul 2005 (CEST))* I have remapped </aleader> <to comma (one hardly ever use commas just before a href= httpletter)* 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/onlineloancontext.theap.info >online loanvim</acode> <a hrefpre>let maplocalleader = http://homeequityloanrefinancingmapleader " Make start-stop block out of the previous wordimap <buffer> <LocalLeader>ta \start<Cr>\stop<Cr><Esc>4bhdiw$pj$pOimap <buffer> <LocalLeader>tb \begin<Cr>\end<Cr><Esc>4bhdiw$pj$pO " Itemizeimap <buffer> <LocalLeader>it \startitemize<Cr>\stopitemize<Esc>O\item<Space>imap <buffer> <LocalLeader>en \startitemize[n]<Cr>\stopitemize<Esc>O\item<Space>imap <buffer> <LocalLeader>i<Return> \item<Space> " Font switching and emphasizeimap <buffer> <LocalLeader>em {\em }<Left>imap <buffer> <LocalLeader>sc {\sc }<Left> " Define... and setup..theap.info imap <buffer> <LocalLeader>de \defineimap <buffer> <LocalLeader>se \setup " Typing and typeimap <buffer> <LocalLeader>ty \type{}<Left>imap <buffer> <LocalLeader>typ typing<LocalLeader>ta " Quote and quotationimap <buffer> <LocalLeader>" \quotation{}<Left>imap <buffer>home equity loan refinancing<LocalLeader>' \quote{}<Left></apre> <a href ==key mappings borrowed from scite== http:If you use the stand-alone distribution for windows//badcreditloanLinux.You can reset the key mappingto speed ConTeXt compiling.theap just add the following code to your _vimrc(or .info vimrc file under Linux) file:<pre>"run setup and complie, then open the result pdf file map <F5>bad credit loan</aEsc> <a href= httpEsc>:sil ! "D://schoolloanconsolidation\context\tex\setuptex.theapbat && texmfstart texexec.info pl --autopdf --pdf '%'"<CR><CR> "view the corresponding pdf filemap <F6>school loan consolidation</aEsc> <a href= httpEsc>:sil ! D://badcredithomeloan\"Program Files"\Adobe\Acrobat\Acrobat.theapexe %:p:r.info pdf<CR><CR> "run setup and make purgemap <F7>bad credit home loan</aEsc> <a href= httpEsc>:sil ! "D://consolidationloan\context\tex\setuptex.theapbat && texmfstart texutil.info pl --purge"<CR>consolidation loan</aCR> "run setup and make list of the current filemap <F8> <Esc> <a href= httpEsc>:sil ! "D://debtconsolidationloan\context\tex\setuptex.theapbat && texmfstart texexec.info pl --autopdf --pdf --list --result=%:p:r_list %"<CR><CR>debt consolidation loan </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 href= httpcontext file, paper.tex paper.pdf: paper.tex texexec paper test: xpdf paper.pdf clean://consolidateloanstudent rm *.bbl *.dvi *.aux *.theaplog *.info blg If you put these mappings to your <code>consolidate loan student.vimrc</acode> 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 <a href= httpF9> ://equityloan.theap.info make<CR>equity loan "map ":make test" to the F8 key imap </aF8> <a href= httpESC>://mortgageloan.theap.info make test<CR>mortgage loan nmap </aF8> :make test<a hrefCR>  == MetaPost extension == http: Should highlight the syntax between <code>btex/verbatimtex</badcreditpersonalloancode> ..theap.info <code>bad credit personal loanetex</acode>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