Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions autoload/vimtex/context/cite.vim
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ function! s:actions.create(entry) abort dict " {{{1
if has_key(a:entry, 'doi')
call add(l:new.menu, {'name': 'Open doi', 'func': 'open_doi'})
endif

if (has_key(a:entry, 'eprint') && (has_key(a:entry, 'archiveprefix') && a:entry.archiveprefix == 'arXiv' || a:entry.eprint[0:4] == 'arXiv'))
call add(l:new.menu, {'name': 'Open arXiv', 'func': 'open_arxiv'})
endif

if has_key(a:entry, 'url')
call add(l:new.menu, {'name': 'Open url', 'func': 'open_url'})
Expand Down Expand Up @@ -166,6 +170,11 @@ function! s:actions.open_pdf() abort dict " {{{1
\ . ' ' . vimtex#util#shellescape(l:file))
endfunction

" }}}1
function! s:actions.open_arxiv() abort dict " {{{1
call vimtex#util#www('http://arxiv.org/abs/' . self.entry.eprint)
endfunction

" }}}1
function! s:actions.open_doi() abort dict " {{{1
call vimtex#util#www('http://dx.doi.org/' . self.entry.doi)
Expand Down