From 4b2bf3070de7467e5b6b7b35c413dcaf690cda98 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Tue, 4 Apr 2023 16:52:54 +0200 Subject: feat(keymap) improve the paste without changing buffer content --- lua/alpha/telescope/setup.lua | 4 ++-- lua/config/keymaps.lua | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'lua') diff --git a/lua/alpha/telescope/setup.lua b/lua/alpha/telescope/setup.lua index 5e4a562..980e418 100644 --- a/lua/alpha/telescope/setup.lua +++ b/lua/alpha/telescope/setup.lua @@ -55,8 +55,8 @@ require("telescope").setup { mappings = { i = { - [""] = false, - [""] = actions.select_horizontal, + -- [""] = false, + -- [""] = actions.select_horizontal, [""] = "move_selection_next", [""] = set_prompt_to_entry_value, diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index adcf4a5..ae03444 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -1,6 +1,10 @@ local map = vim.keymap.set -map("v", "p", '"_dp') +map("v", "p", function() + local val = vim.fn.getreg '"' + vim.api.nvim_command [[normal! p]] + vim.fn.setreg('"', val) +end) map("n", "bd", ":bd!") -- cgit v1.2.3