diff --git a/init.lua b/init.lua index 21e672f..b1a707c 100644 --- a/init.lua +++ b/init.lua @@ -63,7 +63,6 @@ local config = { copilot_no_tab_map = true, copilot_assume_mapped = true, copilot_tab_fallback = "", - vimspector_enable_mappings = 'VISUAL_STUDIO', -- Taglist Tlist_Use_Right_Window = 1, @@ -211,36 +210,42 @@ local config = { ["bt"] = { "BufferLineSortByTabs", desc = "Sort by tabs" }, ["uD"] = { "Alpha", desc = "Alpha dashboard" }, - ["dd"] = { "call vimspector#Launch()", desc = "Launch" }, - ["dS"] = { "call vimspector#Stop()", desc = "Stop" }, - ["dc"] = { "call vimspector#Continue()", desc = "Continue" }, - ["dp"] = { "call vimspector#Pause()", desc = "Pause" }, - ["de"] = { "call vimspector#Reset()", desc = "Reset" }, - ["dr"] = { "call vimspector#Restart()", desc = "Restart" }, - ["dR"] = { "call vimspector#RunToCursor()", desc = "Run to cursor" }, - ["dC"] = { "call vimspector#GoToCurrentLine()", desc = "Go to current line" }, - ["dP"] = { "call vimspector#JumpToProgramCounter()", - desc = "Move Cursor to the program counter in current frame" }, + -- Debugger mappings + -- Config loading + ["dlc"] = { function() require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp" } }) end, desc = "C/C++" }, + -- Function keys mappings + [""] = { function() require("dap").continue() end, desc = "Debugger: Start" }, + [""] = { function() require("dap").terminate() end, desc = "Debugger: Stop" }, -- Shift+F5 + [""] = { function() require("dap").restart_frame() end, desc = "Debugger: Restart" }, -- Control+F5 + [""] = { function() require("dap").pause() end, desc = "Debugger: Pause" }, + [""] = { function() require("dap").toggle_breakpoint() end, desc = "Debugger: Toggle Breakpoint" }, + [""] = { function() require("dap").step_over() end, desc = "Debugger: Step Over" }, + [""] = { function() require("dap").step_into() end, desc = "Debugger: Step Into" }, + [""] = { function() require("dap").step_out() end, desc = "Debugger: Step Out" }, -- Shift+F11 + -- Breakpoints - ["dbt"] = { "call vimspector#ToggleBreakpoint()", desc = "Toggle breakpoint" }, - ["dbl"] = { "call vimspector#ListBreakpoints()", desc = "List breakpoints" }, - ["dbc"] = { "call vimspector#ClearBreakpoints()", desc = "Clear breakpoints" }, - ["dbC"] = { "call vimspector#ToggleBreakpoint( { trigger expr, hit count expr } )", - desc = "Toggle CBreakpoint or LogPoint on current line" }, - ["dbf"] = { "call vimspector#AddFunctionBreakpoint( '' )", - desc = "Add a function breakpoint for expression under cursor" }, - ["dbn"] = { "call vimspector#JumpToNextBreakpoint()", desc = "Jump to next breakpoint" }, - ["dbp"] = { "call vimspector#JumpToPreviousBreakpoint()", desc = "Jump to previous breakpoint" }, - + ["db"] = { function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint (F9)" }, + ["dB"] = { function() require("dap").clear_breakpoints() end, desc = "Clear Breakpoints" }, + + -- Session actions + ["dc"] = { function() require("dap").continue() end, desc = "Start/Continue (F5)" }, + ["dp"] = { function() require("dap").pause() end, desc = "Pause (F6)" }, + ["dr"] = { function() require("dap").restart_frame() end, desc = "Restart (C-F5)" }, + ["dq"] = { function() require("dap").close() end, desc = "Close Session" }, + ["dQ"] = { function() require("dap").terminate() end, desc = "Terminate Session (S-F5)" }, + -- Step - ["dss"] = { "call vimspector#StepOver()", desc = "Step over" }, - ["dsi"] = { "call vimspector#StepInto()", desc = "Step into" }, - ["dso"] = { "call vimspector#StepOut()", desc = "Step out" }, + ["di"] = { function() require("dap").step_into() end, desc = "Step Into (F11)" }, + ["do"] = { function() require("dap").step_over() end, desc = "Step Over (F10)" }, + ["dO"] = { function() require("dap").step_out() end, desc = "Step Out (S-F11)" }, - -- Frames - ["dfu"] = { "call vimspector#UpFrame()", desc = "Up frame" }, - ["dfd"] = { "call vimspector#DownFrame()", desc = "Down frame" }, + -- Repls (debugger) + ["dR"] = { function() require("dap").repl.toggle() end, desc = "Toggle REPL" }, + + -- Dap-UI + ["du"] = { function() require("dapui").toggle() end, desc = "Toggle Debugger UI" }, + ["dh"] = { function() require("dap.ui.widgets").hover() end, desc = "Debugger Hover" }, -- Mardown preview ["mp"] = { "MarkdownPreview", desc = "Markdown preview" }, @@ -314,31 +319,6 @@ local config = { -- require("lsp_signature").setup() -- end, -- }, - -- - -- { "andweeb/presence.nvim", - -- require("presence"):setup({ - -- -- General options - -- auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`) - -- neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image - -- main_image = "neovim", -- Main image display (either "neovim" or "file") - -- client_id = "793271441293967371", -- Use your own Discord application client id (not recommended) - -- log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error") - -- debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(, true)`) - -- enable_line_number = false, -- Displays the current line number instead of the current project - -- blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches - -- buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "