Skip to content

Instantly share code, notes, and snippets.

@ryotako
Created August 29, 2016 21:05
Show Gist options
  • Save ryotako/d841ad7b6418233e4070670f7bfc0d63 to your computer and use it in GitHub Desktop.
Save ryotako/d841ad7b6418233e4070670f7bfc0d63 to your computer and use it in GitHub Desktop.
Beamerのテーマを取得する自作ソース(パスベタ書き)
" my unite source: beamer theme {{{
let s:beamer_themes_path="/usr/local/texlive/2016/texmf-dist/tex/latex/beamer/themes/theme"
let s:unite_source = {
\ 'name': 'beamer_theme',
\ 'description': 'built-in LaTeX beamer themes',
\}
function! s:unite_source.gather_candidates(args, context)
let s:files = filter(split(system('ls '.s:beamer_themes_path)),'v:val =~# "^beamertheme\.\*\\.sty$"')
return map(s:files,'{
\ "word": substitute(v:val[11:],"\.sty$","",""),
\ "source": "beamer_theme",
\ "kind": "word",
\}')
endfunction
call unite#define_source(s:unite_source)
unlet s:unite_source
"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment