tweaks to waybar
This commit is contained in:
parent
5bc9ef28d8
commit
9bf1192cec
6 changed files with 83 additions and 306 deletions
|
|
@ -172,73 +172,75 @@ vim.keymap.set("n", "<leader>dN", "]D", { desc = "Jump to last diagnostic" })
|
|||
vim.keymap.set("n", "<leader>dP", "[D", { desc = "Jump to first diagnostic" })
|
||||
vim.keymap.set("n", "<leader>ds", "<C-w>d", { desc = "Display diagnostic on current line" })
|
||||
|
||||
vim.pack.add({ "https://github.com/mfussenegger/nvim-dap" })
|
||||
|
||||
local dap = require("dap")
|
||||
local dap_widgets = require("dap.ui.widgets")
|
||||
local dap_sidebar_s = dap_widgets.sidebar(dap_widgets.scopes)
|
||||
local dap_sidebar_f = dap_widgets.sidebar(dap_widgets.frames)
|
||||
vim.api.nvim_create_user_command("DapInit", function()
|
||||
vim.pack.add({ "https://github.com/mfussenegger/nvim-dap" })
|
||||
|
||||
vim.keymap.set("n", "<leader>bb", dap.toggle_breakpoint, { desc = "Toggle breakpoint"})
|
||||
vim.keymap.set("n", "<leader>bc", dap.continue, { desc = "Continue execution"})
|
||||
local dap = require("dap")
|
||||
local dap_widgets = require("dap.ui.widgets")
|
||||
local dap_sidebar_s = dap_widgets.sidebar(dap_widgets.scopes)
|
||||
local dap_sidebar_f = dap_widgets.sidebar(dap_widgets.frames)
|
||||
|
||||
dap.listeners.on_session["debug"] = function()
|
||||
vim.keymap.set("n", "<leader>bs", dap_sidebar_s.toggle, { desc = "Show scopes"})
|
||||
vim.keymap.set("n", "<leader>bf", dap_sidebar_f.toggle, { desc = "Show frames"})
|
||||
vim.keymap.set("n", "<leader>bb", dap.toggle_breakpoint, { desc = "Toggle breakpoint"})
|
||||
vim.keymap.set("n", "<leader>bc", dap.continue, { desc = "Continue execution"})
|
||||
|
||||
vim.keymap.set("n", "<Left>", dap.step_out, { desc = "Step out"})
|
||||
vim.keymap.set("n", "<Right>", dap.step_into, { desc = "Step into"})
|
||||
vim.keymap.set("n", "<Down>", dap.step_over, { desc = "Step over"})
|
||||
vim.keymap.set("n", "<Up>", dap.restart_frame, { desc = "Restart frame"})
|
||||
end
|
||||
dap.listeners.on_session["debug"] = function()
|
||||
vim.keymap.set("n", "<leader>bs", dap_sidebar_s.toggle, { desc = "Show scopes"})
|
||||
vim.keymap.set("n", "<leader>bf", dap_sidebar_f.toggle, { desc = "Show frames"})
|
||||
|
||||
dap.adapters.gdb = {
|
||||
type = "executable",
|
||||
command = "gdb",
|
||||
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
|
||||
}
|
||||
vim.keymap.set("n", "<Left>", dap.step_out, { desc = "Step out"})
|
||||
vim.keymap.set("n", "<Right>", dap.step_into, { desc = "Step into"})
|
||||
vim.keymap.set("n", "<Down>", dap.step_over, { desc = "Step over"})
|
||||
vim.keymap.set("n", "<Up>", dap.restart_frame, { desc = "Restart frame"})
|
||||
end
|
||||
|
||||
dap.configurations.c = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "gdb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
args = {}, -- provide arguments if needed
|
||||
cwd = "${workspaceFolder}",
|
||||
stopAtBeginningOfMainSubprogram = false,
|
||||
},
|
||||
{
|
||||
name = "Select and attach to process",
|
||||
type = "gdb",
|
||||
request = "attach",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
pid = function()
|
||||
local name = vim.fn.input('Executable name (filter): ')
|
||||
return require("dap.utils").pick_process({ filter = name })
|
||||
end,
|
||||
cwd = '${workspaceFolder}'
|
||||
},
|
||||
{
|
||||
name = 'Attach to gdbserver :1234',
|
||||
type = 'gdb',
|
||||
request = 'attach',
|
||||
target = 'localhost:1234',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}'
|
||||
dap.adapters.gdb = {
|
||||
type = "executable",
|
||||
command = "gdb",
|
||||
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
|
||||
}
|
||||
}
|
||||
|
||||
dap.configurations.cpp = dap.configurations.c
|
||||
dap.configurations.rust = dap.configurations.c
|
||||
dap.configurations.c = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "gdb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
args = {}, -- provide arguments if needed
|
||||
cwd = "${workspaceFolder}",
|
||||
stopAtBeginningOfMainSubprogram = false,
|
||||
},
|
||||
{
|
||||
name = "Select and attach to process",
|
||||
type = "gdb",
|
||||
request = "attach",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
pid = function()
|
||||
local name = vim.fn.input('Executable name (filter): ')
|
||||
return require("dap.utils").pick_process({ filter = name })
|
||||
end,
|
||||
cwd = '${workspaceFolder}'
|
||||
},
|
||||
{
|
||||
name = 'Attach to gdbserver :1234',
|
||||
type = 'gdb',
|
||||
request = 'attach',
|
||||
target = 'localhost:1234',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}'
|
||||
}
|
||||
}
|
||||
|
||||
dap.configurations.cpp = dap.configurations.c
|
||||
dap.configurations.rust = dap.configurations.c
|
||||
|
||||
end, { desc = "Initialize Debug Adater Protocol support" })
|
||||
|
||||
-- [[ UI Configuration ]]
|
||||
vim.pack.add({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue