Changes

Jump to navigation Jump to search
1,453 bytes added ,  17:54, 8 July 2005
no edit summary
* add metafun macros (from metafun manual)
* should be easy: clone [http://www.vim.org/scripts/script.php?script_id=403 this] script to enable metapost/metafun and XML inside ConTeXt
 
== Powerful key mappings ==
 
a set of buffer-local insert-mode macros to speed up ConTeXt source editing (by [[User:David antos|D.A.]] 19:52, 8 Jul 2005 (CEST))
* I have remapped <leader> to comma (one hardly ever use commas just before a letter)
* 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 .vim/after/plugin/context.vim
<code>
let maplocalleader = mapleader
 
" Make start-stop block out of the previous word
imap <buffer> <LocalLeader>ta \start<Cr>\stop<Cr><Esc>4bhdiw$pj$pO
imap <buffer> <LocalLeader>tb \begin<Cr>\end<Cr><Esc>4bhdiw$pj$pO
 
" Itemize
imap <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 emphasize
imap <buffer> <LocalLeader>em {\em }<Left>
imap <buffer> <LocalLeader>sc {\sc }<Left>
 
" Define... and setup...
imap <buffer> <LocalLeader>de \define
imap <buffer> <LocalLeader>se \setup
 
" Typing and type
imap <buffer> <LocalLeader>ty \type{}<Left>
imap <buffer> <LocalLeader>typ typing<LocalLeader>ta
 
" Quote and quotation
imap <buffer> <LocalLeader>" \quotation{}<Left>
imap <buffer> <LocalLeader>' \quote{}<Left>
</code>

Navigation menu