Ported config from nixvim.

Made some changes to taste along the way,
though there are some still to come.
This commit is contained in:
Gabe Venberg 2025-07-03 02:18:39 +02:00
parent 9a78fd2d53
commit 3bd72ab98f
13 changed files with 601 additions and 740 deletions

View file

@ -7,15 +7,14 @@ require('lze').load {
-- event = "",
-- ft = "",
keys = {
{ "<F5>", desc = "Debug: Start/Continue" },
{ "<F1>", desc = "Debug: Step Into" },
{ "<F2>", desc = "Debug: Step Over" },
{ "<F3>", desc = "Debug: Step Out" },
{ "<F5>", desc = "Debug: Start/Continue" },
{ "<F1>", desc = "Debug: Step Into" },
{ "<F2>", desc = "Debug: Step Over" },
{ "<F3>", desc = "Debug: Step Out" },
{ "<leader>b", desc = "Debug: Toggle Breakpoint" },
{ "<leader>B", desc = "Debug: Set Breakpoint" },
{ "<F7>", desc = "Debug: See last session result." },
{ "<F7>", desc = "Debug: See last session result." },
},
-- colorscheme = "",
load = (require('nixCatsUtils').isNixCats and function(name)
vim.cmd.packadd(name)
vim.cmd.packadd("nvim-dap-ui")
@ -26,9 +25,10 @@ require('lze').load {
vim.cmd.packadd("nvim-dap-virtual-text")
vim.cmd.packadd("mason-nvim-dap.nvim")
end,
after = function (plugin)
after = function(plugin)
local dap = require 'dap'
local dapui = require 'dapui'
require('telescope').load_extension('dap')
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<F5>', dap.continue, { desc = 'Debug: Start/Continue' })
@ -70,15 +70,15 @@ require('lze').load {
}
require("nvim-dap-virtual-text").setup {
enabled = true, -- enable this plugin (the default)
enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination)
highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables)
show_stop_reason = true, -- show stop reason when stopped for exceptions
commented = false, -- prefix virtual text with comment string
only_first_definition = true, -- only show virtual text at first definition (if there are multiple)
all_references = false, -- show virtual text on all all references of the variable (not only definitions)
clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping)
enabled = true, -- enable this plugin (the default)
enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination)
highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables)
show_stop_reason = true, -- show stop reason when stopped for exceptions
commented = false, -- prefix virtual text with comment string
only_first_definition = true, -- only show virtual text at first definition (if there are multiple)
all_references = false, -- show virtual text on all all references of the variable (not only definitions)
clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping)
--- A callback that determines how a variable is displayed or whether it should be omitted
--- variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
--- buf number
@ -97,23 +97,15 @@ require('lze').load {
virt_text_pos = vim.fn.has 'nvim-0.10' == 1 and 'inline' or 'eol',
-- experimental features:
all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine.
virt_lines = false, -- show virtual lines instead of virtual text (will flicker!)
virt_text_win_col = nil -- position the virtual text at a fixed window column (starting from the first text column) ,
all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine.
virt_lines = false, -- show virtual lines instead of virtual text (will flicker!)
virt_text_win_col = nil -- position the virtual text at a fixed window column (starting from the first text column) ,
-- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()`
}
-- NOTE: Install lang specific config
-- either in here, or in a separate plugin spec as demonstrated for go below.
end,
},
end,
},
{
"nvim-dap-go",
for_cat = { cat = 'debug.go', default = false },
on_plugin = { "nvim-dap", },
after = function(plugin)
require("dap-go").setup()
end,
},
}