Open links for \cite{} commands
By lack of a better reference manager, here is a simple code snippet
to open the corresponding doi-link from a \cite{}
command in latex.
function! OpenDoiForCite()
let cite_name = expand('<cword>')
let root = '.'
let bib_files = globpath(root, '**/*.bib', 1, 1)
for file in bib_files
let grepre = '@[a-z]+{' . cite_name . '\s*,(\s*[a-z]+\s*=\s*{[^}]+},?\s*)+}'
let result = system('grep -zoP "' . grepre . '" ' . file)
if result != ''
echo result
let doi = matchlist(result, 'doi\s*=\s*{\([^}]\+\)}')
if len(doi) != 0
echo 'doi:'. string(doi[1])
execute 'silent !chromium-browser "https://doi.org/' . doi[1] . '"<cr>'
return
endif
let title = matchlist(result …