vimtex/autoload/unite/sources/vimtex_toc.vim

28 lines
527 B
VimL
Raw Normal View History

2016-01-24 17:02:33 -05:00
" vimtex - LaTeX plugin for Vim
"
" Maintainer: Karl Yngve Lervåg
" Email: karl.yngve@gmail.com
"
let s:save_cpo = &cpo
set cpo&vim
let s:source = {
\ 'name' : 'vimtex_toc',
\ 'sorters' : 'sorter_nothing',
\}
function! s:source.gather_candidates(args, context)
let entries = vimtex#toc#get_entries()
return map(entries, '{
\ "word" : v:val.title,
\ }')
endfunction
function! unite#sources#vimtex_toc#define()
return s:source
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo