-- @section keymaps -- Custom keymaps migrated from LunarVim config. -- LazyVim already defines many keymaps (e.g. for save, for buffer prev/next, -- bd for delete buffer). Only keymaps that add to or differ from LazyVim defaults -- are listed here. Grouped by function with @section markers. local map = vim.keymap.set --- @section keymaps-buffers -- Meta+number: Jump to specific buffer (via BufferLine) -- 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 }) end --- @section keymaps-picker -- : Quick file find (Snacks picker replaces your Telescope "fd" picker) map("n", "", function() LazyVim.pick("files")() end, { desc = "Find Files" }) --- @section keymaps-external -- Launch external tools from Neovim map("n", "t", ":!konsole&", { desc = "Open Konsole terminal" }) map("n", "g", ":!git gui &", { desc = "Open Git GUI" }) --- @section keymaps-file -- File-level operations map("n", "", ":e!", { desc = "Reload current file (discard changes)" }) map("n", "", function() Snacks.bufdelete() end, { desc = "Delete current buffer (preserves window layout)" }) map("n", "", ":bd!", { desc = "Force delete buffer and close window" }) --- @section keymaps-visual -- Visual mode operations map("v", "", '"fy:%s#f#', { desc = "Replace all occurrences of selected text" }) map("v", "", '"fy/f', { desc = "Search for selected word" }) --- @section keymaps-insert -- Insert mode helpers map("i", "", "A;", { desc = "Append semicolon at end of line" }) map("i", "", "(emmet-expand-abbr)", { desc = "Expand Emmet abbreviation" }) --- @section keymaps-window -- Window navigation with Alt+arrows (preserved from LunarVim) -- LazyVim defaults have for window nav. -- These Alt+arrow mappings give you an alternative. map("n", "", "k", { desc = "Move to window above" }) map("n", "", "j", { desc = "Move to window below" }) map("n", "", "l", { desc = "Move to window right" }) map("n", "", "h", { desc = "Move to window left" }) --- @section keymaps-terminal -- Terminal mode keymaps for window navigation and tab switching map("t", "", "", { desc = "Terminal: Previous tab" }) map("t", "", "", { desc = "Terminal: Next tab" }) map("t", "", "k", { desc = "Terminal: Window up" }) map("t", "", "j", { desc = "Terminal: Window down" }) map("t", "", "l", { desc = "Terminal: Window right" }) map("t", "", "h", { desc = "Terminal: Window left" }) --- @section keymaps-buffer-switch -- Buffer switching keys preserved from LunarVim. -- NOTE: and conflict with LazyVim's default window navigation -- (=window down, =window up). Since you use for windows, -- these override to buffer navigation instead. map("n", "", ":BufferLineCyclePrev", { desc = "Previous buffer" }) map("n", "", ":BufferLineCycleNext", { desc = "Next buffer" }) map("n", "", ":BufferLineMovePrev", { desc = "Move buffer left" }) map("n", "", ":BufferLineMoveNext", { desc = "Move buffer right" }) map("n", "", ":BufferLineCyclePrev", { desc = "Previous buffer" }) map("n", "", ":BufferLineCycleNext", { desc = "Next buffer" }) map("n", "", ":BufferLineMovePrev", { desc = "Move buffer left" }) map("n", "", ":BufferLineMoveNext", { desc = "Move buffer right" }) --- @section keymaps-tab map("n", "", ":tabedit", { desc = "Open new tab" }) --- @section keymaps-dap -- 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() end, { desc = "DAP: Continue / Start debugging" }) map("n", "", function() require("dap").step_over() end, { desc = "DAP: Step over" }) map("n", "", function() require("dap").step_into() end, { desc = "DAP: Step into" }) map("n", "", function() require("dap").step_out() end, { desc = "DAP: Step out" })