contextcomplete.vim 656 B

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