From d912bbe67cbb0cae96d4775a94318817f4cffd4c Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Sun, 8 May 2022 08:45:13 +0530 Subject: [PATCH] mapping: Fix p not copy selected text when clipboard in not set format statusline.lua --- lua/core/mappings.lua | 3 ++- lua/plugins/configs/statusline.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index dd14176..5338657 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -9,7 +9,8 @@ local user_cmd = vim.api.nvim_create_user_command -- Useful when one wants to use that keymap for any other purpose -- Don't copy the replaced text after pasting in visual mode -map("v", "p", "p:let @+=@0") +-- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste +map("v", "p", 'p:let @+=@0:let @"=@0', { silent = true }) -- Allow moving the cursor through wrapped lines with j, k, and -- http ://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/ diff --git a/lua/plugins/configs/statusline.lua b/lua/plugins/configs/statusline.lua index 85fd1f2..706c6db 100644 --- a/lua/plugins/configs/statusline.lua +++ b/lua/plugins/configs/statusline.lua @@ -51,7 +51,8 @@ options.icon_styles = { }, } -options.separator_style = options.icon_styles[require("core.utils").load_config().plugins.options.statusline.separator_style] +options.separator_style = + options.icon_styles[require("core.utils").load_config().plugins.options.statusline.separator_style] options.main_icon = { provider = options.separator_style.main_icon,