nvim: Add bibtex source to cmp autocompletion

Added simple bibtex source display: Will show the bibtex entries
existing in the bib file set through `bibliography: path/to/mine.bib`.
Shows author, title, date on hovering.
This commit is contained in:
Marty Oehme 2023-01-16 18:52:48 +01:00
parent df724c20ba
commit 565a356ea8
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9
2 changed files with 9 additions and 2 deletions

View file

@ -68,14 +68,17 @@ cmp.setup({
},
sources = cmp.config.sources({
{ name = 'path' }, { name = 'nvim_lsp' }, { name = 'treesitter' },
{ name = 'tmux' }, { name = 'vsnip' }, { name = 'latex_symbols' },
{ name = 'vCard' }, { name = 'nvim_lua' }
{ name = 'cmp_pandoc' }, { name = 'tmux' }, { name = 'vsnip' },
{ name = 'latex_symbols' }, { name = 'vCard' }, { name = 'nvim_lua' }
}, { { name = 'buffer' }, { name = 'spell' } })
})
if vim.o.ft == 'clap_input' and vim.o.ft == 'guihua' and vim.o.ft ==
'guihua_rust' then require 'cmp'.setup.buffer { completion = { enable = false } } end
-- set up pandoc bibtex source generation
require 'cmp_pandoc'.setup()
-- Use buffer source for `/` search
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),

View file

@ -236,6 +236,10 @@ require("packer").startup(function()
}
}
use {
'aspeddro/cmp-pandoc.nvim',
requires = {'nvim-lua/plenary.nvim', 'jbyuki/nabla.nvim'}
}
require('plug._cmp')
-- Automatically set up your configuration after cloning packer.nvim