Changes

Jump to navigation Jump to search
704 bytes added ,  12:08, 30 October 2016
no edit summary
so the next time you open a <tt>*.tex</tt> file, Vim will always recognize it as a ConTeXt document.
== Spell-checker A note on spell checking ==
Vim 7 or later has a built-in spell checker. To enable it or disable it, use:
To set the language to be used for spell checking, set the <tt>spelllang</tt> option accordingly. For example:
:set spelllang=en_us
Use lowercase letters (<tt>en_us</tt>, not <tt>en_US</tt>). When you set <tt>spelllang</tt>, Vim offers todownload the language data into your <tt>.vim</tt> folder, if such language is not available.You can put such lines the above settings in your <tt>.vimrc</tt> if you like.
== Using ConTeXt in Vim ==
<b>If you feel that something is missing, please contribute!</b>
Information about providing feedback is in the header of the source scripts.
=== Typesetting ===
The recommended way to typeset a ConTeXt document is to use the <tt>:ConTeXt</tt> command. Just type:
:ConTeXt
to typeset the document in the current buffer. Typesetting happens in the background if you are using Vim 8.0.0047 or later,
nnoremap <silent> ]q :<c-u><c-r>=v:count1<cr>cnext<cr>zz
nnoremap <silent> [q :<c-u><c-r>=v:count1<cr>cprevious<cr>zz
Or install Tim Pope's <i>unimpaired </i> plugin.
If your document is typeset without errors, a <tt>Success!</tt> message appearsis printed at the bottom of the screen.
The <tt>:ConTeXt</tt> command accepts an optional path, in case you want to typeset a document different
You may check the status of your ConTeXt jobs with <tt>:ConTeXtJobStatus</tt>, and you may stop all
running jobs with <tt>:ConTeXtStopJobs</tt>(these commands are available only in Vim 8.0.0047 or later).
An alternative way to typeset a document is to use <tt>:make</tt>. ''Make sure that the current workingdirectory is set to the path to the file you want to compile'' (set with <tt>:lcd …</tt>), and type:
:make
If a <tt>Makefile</tt> is present in the working directory, it will be used. Otherwise, <tt>mtxrun</tt> will
be invoked directly. Note that <tt>:make</tt> always performs synchronous typesetting. Also, if there areerrors, the quickfix list is populated, but you have open it manually with <tt>:copen</tt>.
It is recommended that you map the above commands. For example, you may add
to your <tt>.vimrc</tt>, or (better)
nnoremap <buffer> <silent> <leader>tt :<c-u>update<cr>:ConTeXt<cr>
to <tt>~/.vim/after/ftplugin/context.vim</tt>, after which pressing <tt>\tt</tt> (where <tt>\</tt> is your leader key) will save (if necessary) and compile the file.
You may customize the path to the <tt>mtxrun</tt> executable by setting <tt>g:context_mtxrun</tt>.
For example, if you want to use your ConTeXt Beta installation at <tt>~/Applications/ConTeXt-Beta</tt>,
and you are using macOS, you may set the variable as follows:
let g:context_mtxrun = 'PATH=$HOME/Applications/ConTeXt-Beta/tex/texmf-osx-64/bin:$PATH mtxrun'
TODO: You may decide whether to use synctec by setting the <tt>g:context_synctex</tt>flag to <tt>1</tt> or <tt>0</tt>.For example: let g:context_synctex = 1
Finally, you may pass <tt>mtxrun</tt> additional options by putting them in <tt>g:context_extra_options</tt>.
For example:
let g:context_extra_options = '--arrange --autopdf'
The <tt>--autogenerate</tt>, <tt>--nonstopmode</tt> and <tt>--synctex</tt> options are always included in the
command.
For each of the above variablevariables, a corresponding buffer-local variable with the same name exists, whose value, if defined, take precedenceover the global value.
== Other useful vim plugins ==
134

edits

Navigation menu