From f039924a1347f405e608c2aab9566464325fa279 Mon Sep 17 00:00:00 2001 From: Harish Karumuthil Date: Thu, 25 Jun 2026 12:06:46 +0530 Subject: [PATCH] Update comment uncommet --- .../neovim-distros/LazyVim/nvim/lazyvim.json | 1 - .../LazyVim/nvim/lua/config/autocmds.lua | 6 ----- .../LazyVim/nvim/lua/config/keymaps.lua | 24 ++++++++++++------- .../LazyVim/nvim/lua/plugins/4-plugins.lua | 7 +++++- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lazyvim.json b/home/.local/Apps/neovim-distros/LazyVim/nvim/lazyvim.json index 2089230..e3ccfe3 100644 --- a/home/.local/Apps/neovim-distros/LazyVim/nvim/lazyvim.json +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lazyvim.json @@ -1,7 +1,6 @@ { "extras": [ "lazyvim.plugins.extras.ai.copilot", - "lazyvim.plugins.extras.coding.mini-surround", "lazyvim.plugins.extras.formatting.prettier", "lazyvim.plugins.extras.lang.docker", "lazyvim.plugins.extras.lang.json", diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/autocmds.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/autocmds.lua index ae42aa4..41c18e2 100644 --- a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/autocmds.lua +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/autocmds.lua @@ -63,12 +63,6 @@ vim.api.nvim_create_user_command("Code", function() vim.cmd("!code ./ -g %:" .. (vim.fn.line(".") + 1)) end, { desc = "Open in VS Code at current line" }) ---- @section keymaps-grep (defined as keymap in vim.cmd, moved here for clarity) --- : Search word under cursor with custom Gr command -vim.keymap.set("n", "", function() - vim.cmd("Gr " .. vim.fn.expand("")) -end, { desc = "Grep word under cursor (custom Gr)" }) - -- : Live grep word under cursor via Snacks picker vim.keymap.set("n", "", function() LazyVim.pick("live_grep", { default_text = vim.fn.expand("") })() diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/keymaps.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/keymaps.lua index a72350e..5a5fbbc 100644 --- a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/keymaps.lua +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/keymaps.lua @@ -11,15 +11,15 @@ local map = vim.keymap.set -- LazyVim provides bj for BufferLinePick (interactive pick). -- These direct-access keys are preserved from your LunarVim config. for i = 1, 9 do - map("n", "", function() - vim.cmd("BufferLineGoToBuffer " .. i) - end, { desc = "Go to buffer " .. i }) + map("n", "", function() + vim.cmd("BufferLineGoToBuffer " .. i) + end, { desc = "Go to buffer " .. i }) end --- @section keymaps-picker -- : Quick file find (Snacks picker replaces your Telescope "fd" picker) map("n", "", function() - LazyVim.pick("files")() + LazyVim.pick("files")() end, { desc = "Find Files" }) --- @section keymaps-external @@ -31,10 +31,16 @@ map("n", "g", ":!git gui &", { desc = "Open Git GUI" }) -- File-level operations map("n", "", ":e!", { desc = "Reload current file (discard changes)" }) map("n", "", function() - Snacks.bufdelete() + Snacks.bufdelete() end, { desc = "Delete current buffer (preserves window layout)" }) map("n", "", ":bd!", { desc = "Force delete buffer and close window" }) +--- @section keymaps-comment +-- Toggle comment with Space+/ (normal and visual) +map("n", "c", "gcc", { desc = "Toggle comment", remap = true }) +map("n", "/", "gcc", { desc = "Toggle comment", remap = true }) +-- map("v", "/", "gc", { desc = "Toggle comment" }) + --- @section keymaps-visual -- Visual mode operations map("v", "", '"fy:%s#f#', { desc = "Replace all occurrences of selected text" }) @@ -84,14 +90,14 @@ map("n", "", ":tabedit", { desc = "Open new tab" }) -- Quick DAP access keys (dap.core extra provides d prefix mappings) -- These F-keys provide direct access to the most common debugging actions. map("n", "", function() - require("dap").continue() + require("dap").continue() end, { desc = "DAP: Continue / Start debugging" }) map("n", "", function() - require("dap").step_over() + require("dap").step_over() end, { desc = "DAP: Step over" }) map("n", "", function() - require("dap").step_into() + require("dap").step_into() end, { desc = "DAP: Step into" }) map("n", "", function() - require("dap").step_out() + require("dap").step_out() end, { desc = "DAP: Step out" }) diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/4-plugins.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/4-plugins.lua index 5dfbeb7..b786543 100644 --- a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/4-plugins.lua +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/4-plugins.lua @@ -127,8 +127,13 @@ return { --- @section plugins-nvim-surround { "kylechui/nvim-surround", + keys = { + { "S", mode = "v", desc = "Surround selection" }, + }, config = function() - require("nvim-surround").setup({}) + require("nvim-surround").setup({ + keymaps = { visual = "S" }, + }) end, desc = "Surround text objects (parentheses, quotes, tags, etc.)", },