update
This commit is contained in:
@@ -2,6 +2,8 @@ vim.cmd("set expandtab")
|
||||
vim.cmd("set tabstop=2")
|
||||
vim.cmd("set softtabstop=2")
|
||||
vim.cmd("set shiftwidth=2")
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.g.mapleader = " "
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "9d6826582a3e8c84787bd7355df22a2812a1ad59" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
||||
"nvim-dap": { "branch": "master", "commit": "b516f20b487b0ac6a281e376dfac1d16b5040041" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "f386df19b145607a33885b6110ef5c04faae42cb" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "957f86ae3f049ab6681ed64c05b05768fcaed0d2" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
-- plugins/dap.lua
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
dependencies = {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
"nvim-neotest/nvim-nio", -- wymagane przez dap-ui
|
||||
},
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
|
||||
-- konfiguracja codelldb dla C++
|
||||
dap.adapters.codelldb = {
|
||||
type = "server",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = vim.fn.stdpath("data") .. "/mason/bin/codelldb",
|
||||
args = { "--port", "${port}" },
|
||||
}
|
||||
}
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
-- pyta o ścieżkę do binarki przed debugowaniem
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/build/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = true,
|
||||
stopAtEntry = true,
|
||||
}
|
||||
}
|
||||
|
||||
-- otwiera/zamyka UI automatycznie
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open() end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function() dapui.close() end
|
||||
|
||||
-- bindy
|
||||
vim.keymap.set("n", "<F5>", dap.continue) -- start/continue
|
||||
vim.keymap.set("n", "<F10>", dap.step_over) -- następna linia
|
||||
vim.keymap.set("n", "<F11>", dap.step_into) -- wejdź w funkcję
|
||||
vim.keymap.set("n", "<F12>", dap.step_out) -- wyjdź z funkcji
|
||||
vim.keymap.set("n", "<leader>b", dap.toggle_breakpoint) -- breakpoint
|
||||
vim.keymap.set("n", "<leader>du", dapui.toggle) -- toggle UI
|
||||
|
||||
dapui.setup()
|
||||
end
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user