From 863d20cbfe591cec1749a94aecce348b9aa1a8da Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Mon, 21 Apr 2025 19:34:08 +0000 Subject: [PATCH] feat(keymap): awesome `ycc` keymap from reddit --- lua/core/keymaps.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index 727a2f2..6741e4d 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -51,6 +51,11 @@ vim.keymap.set("s", "", "A") vim.keymap.set("x", "J", ":m '>+1gv", { silent = true, desc = "Move down" }) vim.keymap.set("x", "K", ":m '<-2gv", { silent = true, desc = "Move up" }) +-- credit: https://www.reddit.com/r/neovim/comments/1k4efz8/comment/mo9t5xq +vim.keymap.set("n", "ycc", function() + return 'yy' .. vim.v.count1 .. "gcc']p" +end, { remap = true, expr = true }) + vim.keymap.set("n", "zh", "string(shiftwidth()) . 'zh'", { expr = true }) vim.keymap.set("n", "zl", "string(shiftwidth()) . 'zl'", { expr = true }) -- 2.51.2