aspeddro / cmp-pandoc.nvim

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

A few little things on citations #8

Open bdarcus opened 1 year ago

bdarcus commented 1 year ago

I'm mostly an emacs users, and developer of a bib package over there, but have been experimenting with neovim lately. A few things:

  1. Pandoc syntax does not require a space after the semi-colon here, but this plug-in does. Without the space, completion doesn't activate on references after the first.
  2. Could you strip LaTeX braces and such from the strings for display?
  3. Could you support (BibLaTeX) "date" as an alternative to "year", and "editor" for "author"? I have a local modification that achieves this, that just involves changing two lines. See linked PR if you'd like to add it.
  4. You list cmp-pandoc-references as an alternative, but what are the differences between these two packages?
  5. Also, I just noticed, the brackets disappear below, which is misleading, because pandoc also has a "bare" variant.

image

Finally, maybe useful for the README, here's what I used to get it working with LazyVim:

return {
  {
    "aspeddro/cmp-pandoc.nvim",
    dependencies = { "nvim-lua/plenary.nvim" },
    config = function()
      require("cmp_pandoc").setup()
    end,
  },
  {
    "hrsh7th/nvim-cmp",
    dependencies = { "aspeddro/cmp-pandoc.nvim" },
    opts = function(_, opts)
      local cmp = require("cmp")
      opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "cmp_pandoc" } }))
    end,
  },
}