From cb8be9c3d25247281db21285d0b37f6c9510102f Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Wed, 26 Jun 2024 23:15:42 +0200 Subject: [PATCH] added yanky --- lua/plugins/cmp.lua | 10 ++++++++++ lua/plugins/yanky.lua | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 lua/plugins/yanky.lua diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 13d3cb0..78adc39 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -18,6 +18,7 @@ return { { 'dmitmel/cmp-cmdline-history' }, { 'ray-x/cmp-treesitter' }, { 'hrsh7th/cmp-nvim-lsp-signature-help' }, + { 'chrisgrieser/cmp_yanky' }, { 'p00f/clangd_extensions.nvim' }, { 'windwp/nvim-autopairs', @@ -102,6 +103,15 @@ return { }, { name = 'nvim_lsp_signature_help', priority = 7 }, -- { name = 'treesitter', priority = 6 }, + { + name = 'cmp_yanky', + option = { + -- only suggest items which match the current filetype + onlyCurrentFiletype = false, + -- only suggest items with a minimum length + minLength = 3, + }, + }, { name = 'buffer', priority = 3, diff --git a/lua/plugins/yanky.lua b/lua/plugins/yanky.lua new file mode 100644 index 0000000..8fdf62b --- /dev/null +++ b/lua/plugins/yanky.lua @@ -0,0 +1,13 @@ +return { + 'gbprod/yanky.nvim', + config = function() + require('yanky').setup({}) + vim.keymap.set({ 'n', 'x' }, 'p', '(YankyPutAfter)') + vim.keymap.set({ 'n', 'x' }, 'P', '(YankyPutBefore)') + vim.keymap.set({ 'n', 'x' }, 'gp', '(YankyGPutAfter)') + vim.keymap.set({ 'n', 'x' }, 'gP', '(YankyGPutBefore)') + + vim.keymap.set('n', '', '(YankyPreviousEntry)') + vim.keymap.set('n', '', '(YankyNextEntry)') + end, +}