https://github.com/jc-doyle/cmp-pandoc-references
A source for nvim-cmp, providing completion for bibliography, reference and cross-ref items in Pandoc/Markdown.
https://github.com/jc-doyle/cmp-pandoc-references
nvim-cmp
Last synced: 11 months ago
JSON representation
A source for nvim-cmp, providing completion for bibliography, reference and cross-ref items in Pandoc/Markdown.
- Host: GitHub
- URL: https://github.com/jc-doyle/cmp-pandoc-references
- Owner: jc-doyle
- Created: 2021-09-25T12:01:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-06T09:03:57.000Z (about 2 years ago)
- Last Synced: 2024-11-25T01:33:31.303Z (over 1 year ago)
- Topics: nvim-cmp
- Language: Lua
- Homepage:
- Size: 12.7 KB
- Stars: 59
- Watchers: 2
- Forks: 10
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cmp-pandoc-references
A source for [nvim-cmp](https://github.com/hrsh7th/nvim-cmp), providing completion for bibliography, reference and cross-ref items.
## Demo

Note I have overridden the `ItemKinds`, they are set to `cmp.lsp.CompletionItemKind.Reference` by default.
## Installation & Usage
Assuming Packer:
``` lua
use({
"hrsh7th/nvim-cmp",
requires = {
{ "jc-doyle/cmp-pandoc-references" }
}
})
```
Add the source:
``` lua
require('cmp').setup {
sources = {
{ name = 'pandoc_references' }
}
}
```
## Explanation & Limitations
This source parses and validates the `bibliography: [your/bib/location.bib]` YAML metadata field, to determine the destination of the file (see [Pandoc](https://pandoc.org/MANUAL.html#specifying-bibliographic-data)). If it is not included (or you specify it through a command-line argument), no bibliography completion items will be found.
(I use the metadata block to reference bibliographies, if you'd like automatic scanning of directories/sub-directories, feel free to submit a PR)