aspeddro / cmp-pandoc.nvim

Pandoc source for nvim-cmp
MIT License
37 stars 8 forks source link
nvim nvim-cmp nvim-lua pandoc

cmp-pandoc

Pandoc source for nvim-cmp

image image

Requirements

Features

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

Recomendations

Alternatives