diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 7e58905e..d4a5d633 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -25,6 +25,33 @@ return { -- Add your own debuggers here 'leoluz/nvim-dap-go', + + -- Virtual text support for nvim-dap + { + 'theHamsta/nvim-dap-virtual-text', + opts = { + enabled = true, + enabled_commands = true, + highlight_changed_variables = true, + highlight_new_as_changed = false, + show_stop_reason = true, + commented = false, + only_first_definition = true, + all_references = false, + clear_on_continue = false, + display_callback = function(variable, buf, stackframe, node, options) + if options.virt_text_pos == 'inline' then + return ' = ' .. variable.value:gsub("%s+", " ") + else + return variable.name .. ' = ' .. variable.value:gsub("%s+", " ") + end + end, + virt_text_pos = vim.fn.has 'nvim-0.10' == 1 and 'inline' or 'eol', + all_frames = false, + virt_lines = false, + virt_text_win_col = nil + }, + }, }, keys = { -- Basic debugging keymaps, feel free to change to your liking!