From 30416dbd262bde21b68372d12e8c14eb543bb2ac Mon Sep 17 00:00:00 2001 From: tastytea Date: Sat, 13 Aug 2022 21:28:42 +0200 Subject: [PATCH] nvim: add cmp-dictionary and dict for git --- .config/nvim/lua/my/completion.lua | 18 +++++++++++++++++- .config/nvim/resources/git.dict | 8 ++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .config/nvim/resources/git.dict diff --git a/.config/nvim/lua/my/completion.lua b/.config/nvim/lua/my/completion.lua index 483311f..a25c2ac 100644 --- a/.config/nvim/lua/my/completion.lua +++ b/.config/nvim/lua/my/completion.lua @@ -12,7 +12,8 @@ packer.use { requires = 'https://github.com/L3MON4D3/LuaSnip' }, 'https://github.com/hrsh7th/cmp-nvim-lua', - 'https://github.com/hrsh7th/cmp-nvim-lsp-signature-help' + 'https://github.com/hrsh7th/cmp-nvim-lsp-signature-help', + 'https://github.com/uga-rosa/cmp-dictionary', }, config = function() local cmp = require'cmp' @@ -79,6 +80,14 @@ packer.use { }) }) + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'dictionary' } + }, { + { name = 'buffer' } + }) + }) + -- Use buffer source for `/` cmp.setup.cmdline('/', { mapping = cmp.mapping.preset.cmdline(), @@ -96,5 +105,12 @@ packer.use { { name = 'cmdline' } }) }) + + require('cmp_dictionary').setup({ + dic = { + ['gitcommit'] = + vim.fn.stdpath('config') .. '/resources/git.dict', + } + }) end } diff --git a/.config/nvim/resources/git.dict b/.config/nvim/resources/git.dict new file mode 100644 index 0000000..cb64b50 --- /dev/null +++ b/.config/nvim/resources/git.dict @@ -0,0 +1,8 @@ +Closes: +Bug: +Fixes: +Acked-by: +Reported-by: +Reviewed-by: +Suggested-by: +Tested-by: