nvim-dap: comment out setup
This commit is contained in:
parent
5aef7a5d6e
commit
77504f4af0
1 changed files with 76 additions and 76 deletions
152
init.lua
152
init.lua
|
|
@ -583,82 +583,82 @@ vim.keymap.set("n", "<Leader>cg", builtin.grep_string)
|
||||||
vim.keymap.set("n", "<Leader>:", builtin.commands)
|
vim.keymap.set("n", "<Leader>:", builtin.commands)
|
||||||
vim.keymap.set("n", "<Leader>s", telescope.extensions.luasnip.luasnip)
|
vim.keymap.set("n", "<Leader>s", telescope.extensions.luasnip.luasnip)
|
||||||
---- nvim-dap
|
---- nvim-dap
|
||||||
vim.g.dap_loaded = false
|
-- vim.g.dap_loaded = false
|
||||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
-- vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||||
pattern = { "go", "rust" },
|
-- pattern = { "go", "rust" },
|
||||||
callback = function()
|
-- callback = function()
|
||||||
vim.g.dap_loaded = true
|
-- vim.g.dap_loaded = true
|
||||||
vim.cmd("packadd nvim-dap")
|
-- vim.cmd("packadd nvim-dap")
|
||||||
vim.cmd("packadd nvim-dap-ui")
|
-- vim.cmd("packadd nvim-dap-ui")
|
||||||
vim.cmd("packadd nvim-dap-go")
|
-- vim.cmd("packadd nvim-dap-go")
|
||||||
|
--
|
||||||
local dap = require("dap")
|
-- local dap = require("dap")
|
||||||
vim.fn.sign_define("DapBreakpoint", { text = "🟥", texthl = "", linehl = "", numhl = "" })
|
-- vim.fn.sign_define("DapBreakpoint", { text = "🟥", texthl = "", linehl = "", numhl = "" })
|
||||||
vim.fn.sign_define("DapStopped", { text = "▶️", texthl = "", linehl = "", numhl = "" })
|
-- vim.fn.sign_define("DapStopped", { text = "▶️", texthl = "", linehl = "", numhl = "" })
|
||||||
-- Set keymaps to control the debugger
|
-- -- Set keymaps to control the debugger
|
||||||
vim.keymap.set("n", "<leader>dc", dap.continue)
|
-- vim.keymap.set("n", "<leader>dc", dap.continue)
|
||||||
vim.keymap.set("n", "<leader>do", dap.step_over)
|
-- vim.keymap.set("n", "<leader>do", dap.step_over)
|
||||||
vim.keymap.set("n", "<leader>di", dap.step_into)
|
-- vim.keymap.set("n", "<leader>di", dap.step_into)
|
||||||
vim.keymap.set("n", "<leader>dO", dap.step_out)
|
-- vim.keymap.set("n", "<leader>dO", dap.step_out)
|
||||||
vim.keymap.set("n", "<leader>db", dap.toggle_breakpoint)
|
-- vim.keymap.set("n", "<leader>db", dap.toggle_breakpoint)
|
||||||
vim.keymap.set("n", "<leader>dB", function()
|
-- vim.keymap.set("n", "<leader>dB", function()
|
||||||
dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))
|
-- dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))
|
||||||
end)
|
-- end)
|
||||||
local dapui = require("dapui")
|
-- local dapui = require("dapui")
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
-- dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
dapui.open()
|
-- dapui.open()
|
||||||
end
|
-- end
|
||||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
-- dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||||
dapui.close()
|
-- dapui.close()
|
||||||
end
|
-- end
|
||||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
-- dap.listeners.before.event_exited["dapui_config"] = function()
|
||||||
dapui.close()
|
-- dapui.close()
|
||||||
end
|
-- end
|
||||||
dapui.setup()
|
-- dapui.setup()
|
||||||
|
--
|
||||||
-- rust
|
-- -- rust
|
||||||
dap.adapters.lldb = {
|
-- dap.adapters.lldb = {
|
||||||
type = 'executable',
|
-- type = 'executable',
|
||||||
command = '/usr/bin/lldb-vscode',
|
-- command = '/usr/bin/lldb-vscode',
|
||||||
name = 'lldb'
|
-- name = 'lldb'
|
||||||
}
|
-- }
|
||||||
dap.configurations.rust = {
|
-- dap.configurations.rust = {
|
||||||
{
|
-- {
|
||||||
name = 'Launch',
|
-- name = 'Launch',
|
||||||
type = 'lldb',
|
-- type = 'lldb',
|
||||||
request = 'launch',
|
-- request = 'launch',
|
||||||
program = function()
|
-- program = function()
|
||||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
-- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||||
end,
|
-- end,
|
||||||
cwd = '${workspaceFolder}',
|
-- cwd = '${workspaceFolder}',
|
||||||
stopOnEntry = false,
|
-- stopOnEntry = false,
|
||||||
args = {},
|
-- args = {},
|
||||||
initCommands = function()
|
-- initCommands = function()
|
||||||
-- Find out where to look for the pretty printer Python module
|
-- -- Find out where to look for the pretty printer Python module
|
||||||
local rustc_sysroot = vim.fn.trim(vim.fn.system('rustc --print sysroot'))
|
-- local rustc_sysroot = vim.fn.trim(vim.fn.system('rustc --print sysroot'))
|
||||||
|
--
|
||||||
local script_import = 'command script import "' .. rustc_sysroot .. '/lib/rustlib/etc/lldb_lookup.py"'
|
-- local script_import = 'command script import "' .. rustc_sysroot .. '/lib/rustlib/etc/lldb_lookup.py"'
|
||||||
local commands_file = rustc_sysroot .. '/lib/rustlib/etc/lldb_commands'
|
-- local commands_file = rustc_sysroot .. '/lib/rustlib/etc/lldb_commands'
|
||||||
|
--
|
||||||
local commands = {}
|
-- local commands = {}
|
||||||
local file = io.open(commands_file, 'r')
|
-- local file = io.open(commands_file, 'r')
|
||||||
if file then
|
-- if file then
|
||||||
for line in file:lines() do
|
-- for line in file:lines() do
|
||||||
table.insert(commands, line)
|
-- table.insert(commands, line)
|
||||||
end
|
-- end
|
||||||
file:close()
|
-- file:close()
|
||||||
end
|
-- end
|
||||||
table.insert(commands, 1, script_import)
|
-- table.insert(commands, 1, script_import)
|
||||||
|
--
|
||||||
return commands
|
-- return commands
|
||||||
end,
|
-- end,
|
||||||
},
|
-- },
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
-- nvim-dap-go
|
-- -- nvim-dap-go
|
||||||
require("dap-go").setup()
|
-- require("dap-go").setup()
|
||||||
end,
|
-- end,
|
||||||
})
|
-- })
|
||||||
|
|
||||||
---- web-devicons
|
---- web-devicons
|
||||||
require("nvim-web-devicons").setup()
|
require("nvim-web-devicons").setup()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue