vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

contextcomplete.vim (656B)


      1 " Language:           ConTeXt typesetting engine
      2 " Maintainer:         Nicola Vitacolonna <nvitacolonna@gmail.com>
      3 " Latest Revision:    2016 Oct 15
      4 
      5 let s:keepcpo= &cpo
      6 set cpo&vim
      7 
      8 " Complete keywords in MetaPost blocks
      9 function! contextcomplete#Complete(findstart, base)
     10   if a:findstart == 1
     11     if len(synstack(line('.'), 1)) > 0 &&
     12           \ synIDattr(synstack(line('.'), 1)[0], "name") ==# 'contextMPGraphic'
     13       return syntaxcomplete#Complete(a:findstart, a:base)
     14     else
     15       return -3
     16     endif
     17   else
     18     return syntaxcomplete#Complete(a:findstart, a:base)
     19   endif
     20 endfunction
     21 
     22 let &cpo = s:keepcpo
     23 unlet s:keepcpo
     24 
     25 " vim: sw=2 fdm=marker