From ba5d5d2561e0a25c4df9f2d22acf85cf1c8d4fd0 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 3 May 2022 11:57:57 +0200 Subject: [PATCH] nvim: Fix cmp cmp-pandoc completion --- nvim/.config/nvim/lua/plug/_cmp.lua | 23 +++++++++++------------ nvim/.config/nvim/lua/plugins.lua | 6 +++--- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/nvim/.config/nvim/lua/plug/_cmp.lua b/nvim/.config/nvim/lua/plug/_cmp.lua index 244cb49..b4c0329 100644 --- a/nvim/.config/nvim/lua/plug/_cmp.lua +++ b/nvim/.config/nvim/lua/plug/_cmp.lua @@ -69,17 +69,24 @@ cmp.setup({ sources = cmp.config.sources({ {name = 'path'}, {name = 'nvim_lsp'}, {name = 'treesitter'}, {name = 'tmux'}, {name = 'vsnip'}, {name = 'latex_symbols'}, - {name = 'pandoc_references'}, {name = 'vCard'} - }, {{name = 'buffer'}, {name = 'spell'}}) + {name = 'cmp_pandoc'}, {name = 'vCard'}, { name = 'nvim_lua'} }, + {{name = 'buffer'}, {name = 'spell'}} + ) }) +require 'cmp_pandoc'.setup{ + bibliography = { + fields = { "type", "title", "author", "date" } + } +} + if vim.o.ft == 'clap_input' and vim.o.ft == 'guihua' and vim.o.ft == 'guihua_rust' then require'cmp'.setup.buffer {completion = {enable = false}} end -- Use buffer source for `/` search cmp.setup.cmdline('/', { mapping = cmp.mapping.preset.cmdline(), - sources = {{name = 'buffer'}}} -) + sources = cmp.config.sources({{name = 'buffer'}}) +}) -- Use cmdline & path source for ':' in vim cmp.setup.cmdline(':', { @@ -87,13 +94,5 @@ cmp.setup.cmdline(':', { sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}}) }) -cmp.setup.filetype('gitcommit', { -sources = cmp.config.sources({ - { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. -}, { - { name = 'buffer' }, -}) -}) - require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol .make_client_capabilities()) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 1084976..a9048da 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -225,10 +225,10 @@ require("packer").startup(function() requires = { 'onsails/lspkind-nvim', 'andersevenrud/cmp-tmux', -- completion source from adjacent tmux panes 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-vsnip', + 'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-vsnip', 'hrsh7th/cmp-nvim-lua', 'kdheepak/cmp-latex-symbols', 'ray-x/cmp-treesitter', - 'f3fora/cmp-spell', 'jc-doyle/cmp-pandoc-references', - 'cbarrete/completion-vcard' + 'f3fora/cmp-spell', 'cbarrete/completion-vcard', + 'aspeddro/cmp-pandoc.nvim', 'nvim-lua/plenary.nvim', 'jbyuki/nabla.nvim' -- pandoc requires the 2 following } } require('plug._cmp')