dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

ultisnips_complete.vim (702B)


      1 function! ultisnips_complete#ListSnippets(findstart, base) abort
      2   if empty(UltiSnips#SnippetsInCurrentScope(1))
      3     return ''
      4   endif
      5 
      6   if a:findstart
      7     " locate the start of the word
      8     let line = getline('.')
      9     let start = col('.') - 1
     10     while start > 0 && (line[start - 1] =~ '\a')
     11       let start -= 1
     12     endwhile
     13     return start
     14   else
     15     " find classes matching "a:base"
     16     let res = []
     17     for m in keys(g:current_ulti_dict_info)
     18       if m =~ "^" . a:base
     19         let n = {
     20               \ 'word': m,
     21               \ 'menu': '[snip] '. g:current_ulti_dict_info[m]['description']
     22               \ }
     23         call add(res, n)
     24       endif
     25     endfor
     26     return res
     27   endif
     28 endfunction
     29