vimtex/autoload/unite/sources/vimtex_toc.vim

33 lines
658 B
VimL
Raw Normal View History

2016-01-24 23:02:33 +01: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',
2016-01-24 23:11:39 +01:00
\ 'default_kind' : 'jump_list',
2016-01-24 23:02:33 +01:00
\}
2016-01-24 23:11:39 +01:00
function! s:source.gather_candidates(args, context) " {{{1
2016-01-24 23:02:33 +01:00
let entries = vimtex#toc#get_entries()
return map(entries, '{
\ "word" : v:val.title,
2016-01-24 23:11:39 +01:00
\ "action__path" : v:val.file,
\ "action__line" : v:val.line,
2016-01-24 23:02:33 +01:00
\ }')
endfunction
2016-01-24 23:11:39 +01:00
" }}}1
2016-01-24 23:02:33 +01:00
function! unite#sources#vimtex_toc#define()
return s:source
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo