Changes

Jump to navigation Jump to search
19 bytes removed ,  10:57, 30 October 2016
no edit summary
http://www.vim.org/
This page will be is about editing ConTeXt source in (g)vimVim, gVim, MacVim, NeoVim, and other Vim clones. Some of the described features are available only in Vim v8.0.0047 or later.
== Filetype detection ==
Tex TeX (plain texPlain TeX), latex LaTex and context ConTeXt all use the <code>.tex</code> extension for files , which makes it difficult to detect the filetype based on the extension. From Vim 7 onwards, vim Vim does some intelligent checking to see it the file is <code>plaintex </code> or <code>latex </code> or <code>context</code>.
If the first line of a <code>*.tex </code> file has the form
%&<format>
then this determined determines the file type: <code>plaintex </code> (for plain Plain TeX), <code>context </code> (forConTeXt), or <code>tex <code> (for LaTeX). Otherwise, the file is searched for keywords tochoose <code>context </code> or <code>tex</code>. If no keywords are found, it defaults to <code>plaintex</code>.You can change the default by defining the variable <code>g:tex_flavor </code> to the format
(not the file type) you use most. Use one of these:
let g:tex_flavor = "plain"
Currently no other formats are recognized.
* If you use ConTeXt most of the time, but occasionally use latex LaTeX or plaintexPlain TeX, you can add the following to your <code>.vimrc</code>
let g:tex_flavor = "context"
* If you only use ConTeXt, you can add the following lines to <code>filetype.vim</code>:
" ConTeXt
augroup filetypedetect
au! BufRead,BufNewFile *.tex setfiletype context
augroup END
so the next time you open a <code>*.tex</code> file, vim Vim will recognise always recognize it as a context fileConTeXt document.
== Spell-checker ==
Vim 7 has a built-in spell checker, butenabling the . To enable Vim's spell-checker has been "forgotten" in <code>context.vim</code>. Either saychecking: :syn set spell toplevelafter opening To set the document or add syn language to be used for spell toplevelsomewhere on checking, set the top of <code>runtime/syntax/context`spelllang` option accordingly.vim</code>, as in: runtime! syntax/plaintex.vim let sFor example:cpo_save = &cpo set cpo&vim syn spell toplevel Additionally, you have to set :set spell spelllang=en_usor the language of your preference once you have installed it into vim.Use lowercase letters (<code>en_us</code> , not <code>en_US</code>).You can put this line such lines in your <code>.vimrc</code> if you like.
== ftplugin and syntax file ==
134

edits

Navigation menu