cmp-pandoc.nvim
cmp-pandoc.nvim copied to clipboard
Pandoc source for nvim-cmp
cmp-pandoc
Pandoc source for nvim-cmp

Requirements
Neovim >= 0.5.0plenary.nvim
Features
- Multiple bibliography files
- Support pandoc-crossref
- Equation preview with
nabla.nvim
Installation
packer.nvim
use {
'aspeddro/cmp-pandoc.nvim',
requires = {
'nvim-lua/plenary.nvim',
'jbyuki/nabla.nvim' -- optional
}
}
vim-plug
Plug 'nvim-lua/plenary.nvim'
Plug 'jbyuki/nabla.nvim' "optional
Plug 'aspeddro/cmp-pandoc.nvim'
Setup
require'cmp'.setup{
sources = {
{ name = 'cmp_pandoc' }
}
}
require'cmp_pandoc'.setup()
Configuration (optional)
Following are the default config for the setup(). If you want to override, just modify the option that you want then it will be merged with the default config.
{
-- What types of files cmp-pandoc works.
-- 'pandoc', 'markdown' and 'rmd' (Rmarkdown)
-- @type: table of string
filetypes = { "pandoc", "markdown", "rmd" },
-- Customize bib documentation
bibliography = {
-- Enable bibliography documentation
-- @type: boolean
documentation = true,
-- Fields to show in documentation
-- @type: table of string
fields = { "type", "title", "author", "year" },
},
-- Crossref
crossref = {
-- Enable documetation
-- @type: boolean
documentation = true,
-- Use nabla.nvim to render LaTeX equation to ASCII
-- @type: boolean
enable_nabla = false,
}
}
Basic Syntax
Add bibliography file on YAML Header
---
bibliography: path/to/references.bib
---
Multiple bibliography files:
---
bibliography:
- path/to/references.bib
- path/to/other/references.bib
---
A YAML metadata block is a valid YAML object, delimited by a line of three hyphens
---at the top and a line of three hyphens---or three dots...at the bottom. A YAML metadata block may occur anywhere in the document, but if it is not at the beginning, it must be preceded by a blank line. Pandoc.org
More details, see pandoc-crossref
Limitations
-
YAML metadata inside code blocks with
bibliographyfield enablecmp-pandoc. The parser does not check if it is inside a fenced code block. -
Pandoc crossref support a couple options to add code block labels, but only the following style is supported:
```haskell main :: IO () main = putStrLn "Hello World!" ``` : Listing caption {#lst:code}