From d36040544741e757e71f1f73f43b700e02c75851 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Wed, 21 Apr 2021 12:46:24 +0530 Subject: [PATCH] mappings: dont copy deleted text --- init.lua | 2 +- lua/mappings/lua.lua | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 170dd09..70c2e5e 100644 --- a/init.lua +++ b/init.lua @@ -17,7 +17,7 @@ local cmd = vim.cmd local g = vim.g g.mapleader = " " -g.auto_save = 1 +g.auto_save = 0 -- colorscheme related stuff diff --git a/lua/mappings/lua.lua b/lua/mappings/lua.lua index aef5e6e..710e29a 100644 --- a/lua/mappings/lua.lua +++ b/lua/mappings/lua.lua @@ -6,6 +6,17 @@ local function map(mode, lhs, rhs, opts) vim.api.nvim_set_keymap(mode, lhs, rhs, options) end +local opt = {} + +-- dont copy any deleted text , this is disabled by default so uncomment the below mappings if you want them! +--[[ + +map("n", "dd", [=[ "_dd ]=], opt) +map("v", "dd", [=[ "_dd ]=], opt) +map("v", "x", [=[ "_x ]=], opt) + +]] + -- copy any selected text with pressing y map("", "c", '"+y')