Changes

Jump to navigation Jump to search
710 bytes added ,  08:27, 31 October 2016
no edit summary
This page is about editing ConTeXt source in Vim, gVim, MacVim, NeoVim, and other Vim clones.
The page describes the scripts available with Vim v8.0.0055 or later.If you are using an older Vim7, you may copy see[[Using the <tt>context.vim</tt> scripts from Vim's distribution (https://github.com/vim/vim) under the <tt>runtime</tt> directory into correspondingfolders in your <tt>.vim</tt> folder (so, for example <tt>ftplugin/context.vim</tt> must be copied into<tt>~/.vim/ftplugin/context.vim</tt>).Everything should work, at least with an older Vim 7.4]].
== Using ConTeXt in Vim ==
let g:context_include = { 'cpp' : 'CPP' }
The key is the name of the filetype and the corresponding value is name of the command.
 
=== Using the scripts with an older Vim ===
 
If you are using an older Vim, you may copy the following scripts from Vim's distribution
(https://github.com/vim/vim) into corresponding
folders in your <tt>.vim</tt> folder (so, for example <tt>runtime/ftplugin/context.vim</tt> must be copied into
<tt>~/.vim/ftplugin/context.vim</tt>):
 
runtime/autoload/context.vim
runtime/autoload/contextcomplete.vim
runtime/compiler/context.vim
runtime/ftplugin/{context,mf,mp}.vim
runtime/indent/{context,mf,mp}.vim
runtime/syntax/{context,mf,mp}.vim
 
If you get the following error when you open a ConTeXt or MetaPost document:
 
E410: Invalid :syntax subcommand:
 
edit the syntax files and remove the <tt>syn iskeyword</tt> or <tt>syntax iskeyword</tt> line.
Instead, put a corresponding command in <tt>~/.vim/after/ftplugin/context.vim</tt>:
 
setlocal iskeyword=@,48-57,a-z,A-Z,192-255
 
and in <tt>~/.vim/after/ftplugin/mp.vim</tt> for MetaPost:
 
setlocal iskeyword=@,_
 
Everything should work, at least with Vim 7.4.
=== TODO ===
134

edits

Navigation menu