From 21522bd1948f648659061a46002a2b1fc4b0f392 Mon Sep 17 00:00:00 2001 From: jdhao Date: Sun, 25 Aug 2024 23:33:34 +0200 Subject: [PATCH] update config for yanky --- lua/config/yanky.lua | 20 ++++++++++++-------- lua/plugin_specs.lua | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lua/config/yanky.lua b/lua/config/yanky.lua index 0f8eceb..2c7b134 100644 --- a/lua/config/yanky.lua +++ b/lua/config/yanky.lua @@ -1,13 +1,17 @@ -require("yanky").setup({ - ring = { - history_length = 50, - storage = "memory", - }, +require("yanky").setup { preserve_cursor_position = { enabled = false, }, -}) + highlight = { + on_put = true, + on_yank = false, + timer = 300, + }, +} + +vim.keymap.set({ "n", "x" }, "p", "(YankyPutAfter)") +vim.keymap.set({ "n", "x" }, "P", "(YankyPutBefore)") -- cycle through the yank history, only work after paste -vim.keymap.set("n", "[y", "(YankyCycleForward)") -vim.keymap.set("n", "]y", "(YankyCycleBackward)") +vim.keymap.set("n", "[y", "(YankyPreviousEntry)") +vim.keymap.set("n", "]y", "(YankyNextEntry)") diff --git a/lua/plugin_specs.lua b/lua/plugin_specs.lua index 3e9127d..5e1e9b4 100644 --- a/lua/plugin_specs.lua +++ b/lua/plugin_specs.lua @@ -293,10 +293,10 @@ local plugin_specs = { -- Manage your yank history { "gbprod/yanky.nvim", - cmd = { "YankyRingHistory" }, config = function() require("config.yanky") end, + event = "VeryLazy", }, -- Handy unix command inside Vim (Rename, Move etc.)