Warning
Project status: Alpha.
biblioteca.nvim is primarily a Neovim plugin for managing citation data. However, the heavy-lifting is implemented in Rust, which is provided both as library and CLI which and can be used independently.
- Supported bibliography sources: biblatex, bibtex,, CSL-JSON.
- Fuzzy finder sources: fzf.vim, fzf.lua, telescope, vim.ui.select.
- Configurable fuzzy finder actions
- Buffer local citations
- nvim-cmp source
- Lua API to work with citation entries.
neovim >= 0.10
cargo
, required to manually build the Rust library.
{
'chenlijun99/biblioteca',
build = "./install.sh",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim", -- optional
"ibhagwan/fzf-lua", -- optional
"L3MON4D3/LuaSnip", -- optional
},
version = '^1', -- Recommended
lazy = false, -- This plugin is already lazy
}
Tip
It is suggested to pin to tagged releases if you would like to avoid breaking changes.
Tip
See :h biblioteca
for a detailed documentation of everything.
vim.g.biblioteca = {
sources = {
my_source_id = {
type = "biblatex",
file = "/path/to/file.bib"
citation_style = {
style = "ieee",
locale = "en_US"
},
},
-- ...
},
fmt = function(source_id, item_key, item, csl_formatted)
return "[item_key] {item.shorttitle} {formatted} [source_id]"
end,
cache_fmt = true,
pickers = {
fzf_vim = {
-- ...
},
fzf_lua = {
-- ...
},
telescope = {
-- ...
}
}
}
require('biblioteca').setup()
-- For integration with L3MON4D3/LuaSnip
require('biblioteca.integrations.luasnip').setup({
})
To modify the default configuration, set vim.g.biblioteca
.
require('biblioteca.pickers.fzf_lua').bibliography()
require('biblioteca.pickers.fzf_vim').bibliography()
require('biblioteca').get_citation_data(<citation key>)
For a health check, run :checkhealth biblioteca
- obsidian-citation-plugin: source of inspiration. I wanted to rely less on Obsidian.
- ColinKennedy/nvim-best-practices-plugin-template and nvim-best-practices: for best practices.
- Loading a Rust library as a Lua module in Neovim: got me started on Lua-Rust interoperability.
- Examples of good Neovim plugins I took inspiration from:
- NeogitOrg/neogit: a nice example showing how a single plugin can support multiple pickers.
- mrcjkb/rustaceanvim
- Of course, credits goes to all the dependencies this repository relies on.
- rafaqz/citation.vim:
- Supports bibtex files (via pybtex) and directly reading from the Zotero Sqlite database.
- Provides Unite.vim sources for citations.
- Implemented in VimScript.
- ferdinandyb/bibtexcite.vim
- Relies on bibtool and fzf-bibtex.
- Provides FZF source for citations.
- Implemented in VimScript.
- fzf-bibtex
- Documents how to integrate with fzf.vim and fzf.lua. Basically, read from the output cache of the
fzf-bibtex
CLI tool.
- Documents how to integrate with fzf.vim and fzf.lua. Basically, read from the output cache of the
- jalvesaq/zotcite
- Supports Zotero. Directly reads from the Zotero sqlite database.
- Doesn't support bibtex.
- Provides FZF source for Zotero citations, annotations, etc.
- Implemented in Lua and Python.
What is missing?
- Given a citation key, obtain a table containing the data about the citation entry and perform arbitrary operation with the data. E.g. open a literature note, expand a template and fill citation entry data automatically, etc.
- Lack support for arbitrary citation styles.