From 77504f4af04c91aa3a7552975a05bb28b3fcb1b2 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Salinas Date: Thu, 6 Jun 2024 17:25:15 -0400 Subject: [PATCH] nvim-dap: comment out setup --- init.lua | 152 +++++++++++++++++++++++++++---------------------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/init.lua b/init.lua index bc7d7a2..2ac3104 100644 --- a/init.lua +++ b/init.lua @@ -583,82 +583,82 @@ vim.keymap.set("n", "cg", builtin.grep_string) vim.keymap.set("n", ":", builtin.commands) vim.keymap.set("n", "s", telescope.extensions.luasnip.luasnip) ---- nvim-dap -vim.g.dap_loaded = false -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "go", "rust" }, - callback = function() - vim.g.dap_loaded = true - vim.cmd("packadd nvim-dap") - vim.cmd("packadd nvim-dap-ui") - vim.cmd("packadd nvim-dap-go") - - local dap = require("dap") - vim.fn.sign_define("DapBreakpoint", { text = "🟥", texthl = "", linehl = "", numhl = "" }) - vim.fn.sign_define("DapStopped", { text = "▶️", texthl = "", linehl = "", numhl = "" }) - -- Set keymaps to control the debugger - vim.keymap.set("n", "dc", dap.continue) - vim.keymap.set("n", "do", dap.step_over) - vim.keymap.set("n", "di", dap.step_into) - vim.keymap.set("n", "dO", dap.step_out) - vim.keymap.set("n", "db", dap.toggle_breakpoint) - vim.keymap.set("n", "dB", function() - dap.set_breakpoint(vim.fn.input("Breakpoint condition: ")) - end) - local dapui = require("dapui") - dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open() - end - dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close() - end - dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close() - end - dapui.setup() - - -- rust - dap.adapters.lldb = { - type = 'executable', - command = '/usr/bin/lldb-vscode', - name = 'lldb' - } - dap.configurations.rust = { - { - name = 'Launch', - type = 'lldb', - request = 'launch', - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') - end, - cwd = '${workspaceFolder}', - stopOnEntry = false, - args = {}, - initCommands = function() - -- Find out where to look for the pretty printer Python module - 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 commands_file = rustc_sysroot .. '/lib/rustlib/etc/lldb_commands' - - local commands = {} - local file = io.open(commands_file, 'r') - if file then - for line in file:lines() do - table.insert(commands, line) - end - file:close() - end - table.insert(commands, 1, script_import) - - return commands - end, - }, - } - - -- nvim-dap-go - require("dap-go").setup() - end, -}) +-- vim.g.dap_loaded = false +-- vim.api.nvim_create_autocmd({ "FileType" }, { +-- pattern = { "go", "rust" }, +-- callback = function() +-- vim.g.dap_loaded = true +-- vim.cmd("packadd nvim-dap") +-- vim.cmd("packadd nvim-dap-ui") +-- vim.cmd("packadd nvim-dap-go") +-- +-- local dap = require("dap") +-- vim.fn.sign_define("DapBreakpoint", { text = "🟥", texthl = "", linehl = "", numhl = "" }) +-- vim.fn.sign_define("DapStopped", { text = "▶️", texthl = "", linehl = "", numhl = "" }) +-- -- Set keymaps to control the debugger +-- vim.keymap.set("n", "dc", dap.continue) +-- vim.keymap.set("n", "do", dap.step_over) +-- vim.keymap.set("n", "di", dap.step_into) +-- vim.keymap.set("n", "dO", dap.step_out) +-- vim.keymap.set("n", "db", dap.toggle_breakpoint) +-- vim.keymap.set("n", "dB", function() +-- dap.set_breakpoint(vim.fn.input("Breakpoint condition: ")) +-- end) +-- local dapui = require("dapui") +-- dap.listeners.after.event_initialized["dapui_config"] = function() +-- dapui.open() +-- end +-- dap.listeners.before.event_terminated["dapui_config"] = function() +-- dapui.close() +-- end +-- dap.listeners.before.event_exited["dapui_config"] = function() +-- dapui.close() +-- end +-- dapui.setup() +-- +-- -- rust +-- dap.adapters.lldb = { +-- type = 'executable', +-- command = '/usr/bin/lldb-vscode', +-- name = 'lldb' +-- } +-- dap.configurations.rust = { +-- { +-- name = 'Launch', +-- type = 'lldb', +-- request = 'launch', +-- program = function() +-- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') +-- end, +-- cwd = '${workspaceFolder}', +-- stopOnEntry = false, +-- args = {}, +-- initCommands = function() +-- -- Find out where to look for the pretty printer Python module +-- 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 commands_file = rustc_sysroot .. '/lib/rustlib/etc/lldb_commands' +-- +-- local commands = {} +-- local file = io.open(commands_file, 'r') +-- if file then +-- for line in file:lines() do +-- table.insert(commands, line) +-- end +-- file:close() +-- end +-- table.insert(commands, 1, script_import) +-- +-- return commands +-- end, +-- }, +-- } +-- +-- -- nvim-dap-go +-- require("dap-go").setup() +-- end, +-- }) ---- web-devicons require("nvim-web-devicons").setup()