dap and nerdtree fixes

This commit is contained in:
Christian Nieves
2024-01-30 17:27:26 +00:00
parent 16fb43e7a2
commit 90033636e5
4 changed files with 65 additions and 31 deletions

View File

@ -20,9 +20,30 @@ return {
{ "<leader>dt", ":Telescope dap configurations<CR>" },
},
config = function()
local use_google = require("utils").use_google
require("telescope").load_extension("dap")
local dap = require("dap")
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError" })
vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "DiagnosticSignError" })
vim.fn.sign_define("DapBreakpointRejected", { text = "", texthl = "DiagnosticSignError" })
dap.adapters.java = {}
dap.adapters.cpp = {}
if use_google then
dap.adapters.lldb = {
type = "executable",
-- sudo apt install google-lldb-vscode
command = "/usr/share/code/resources/app/extensions/google-lldb-vscode/bin/lldb-dap",
name = "lldb",
sourceMap = {
{ "/proc/self/cwd", "${workspaceFolder}" },
},
cwd = "${workspaceFolder}",
debuggerRoot = "${workspaceFolder}",
sourcePath = "${workspaceFolder}",
}
end
dap.adapters.godot = {
type = "server",
@ -30,12 +51,41 @@ return {
port = 6006,
}
dap.configurations.cpp = {
{
-- If you get an "Operation not permitted" error using this, try disabling YAMA:
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
name = "Attach to process",
type = "lldb",
request = "attach",
pid = require("dap.utils").pick_process,
args = {},
},
{
name = "Wait for process name",
type = "lldb",
request = "attach",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
waitFor = true,
},
{
type = "lldb",
request = "attach",
mode = "remote",
name = "Attach Remote",
attachCommands = { "gdb-remote 5555" },
-- hostName = "127.0.0.1",
-- port = 5555,
},
}
dap.configurations.java = {
{
type = "java",
request = "attach",
mode = "remote",
name = "Java - Attach Remote",
name = "Attach Remote",
cwd = "${workspaceFolder}",
hostName = "127.0.0.1",
port = 5005,
@ -43,14 +93,14 @@ return {
}
dap.configurations.gdscript = {
{
name = "Godot - Launch Project",
name = "Launch Project",
type = "godot",
request = "launch",
project = "${workspaceFolder}",
additional_options = "",
},
{
name = "Godot - Launch Current File",
name = "Launch Current File",
type = "godot",
request = "launch",
scene = "current",

View File

@ -30,11 +30,11 @@ return {
glug("alert"),
glug("csearch"),
glug("languages"),
-- glug("googlestyle"),
glug("googlespell"),
-- Enable logmsgs ASAP to avoid maktaba's log message queue filling up
veryLazy(glug("logmsgs")),
veryLazy(glug("googler")),
glug("google-logo"),
-- Add support for google filetypes
veryLazy(glug("google-filetypes", {
event = "BufReadPre",
@ -53,6 +53,7 @@ return {
veryLazy(glug("ft-soy")),
-- Configures nvim to respect Google's coding style
veryLazy(glug("googlestyle")),
veryLazy(glug("add_usings")),
-- Autogens boilerplate when creating new files
glug("autogen", {
event = "BufNewFile",

View File

@ -2,6 +2,12 @@ return {
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
-- cmd = {
-- "NeoTreeFocusToggle",
-- "NeoTreeFloatToggle",
-- "NeoTreeRevealToggle",
-- "NeoTreeShowToggle",
-- },
config = function()
require("neo-tree").setup({
sources = {
@ -17,32 +23,6 @@ return {
["O"] = "expand_all_nodes",
},
},
event_handlers = {
{
event = "neo_tree_buffer_enter",
handler = function(arg)
vim.opt.mouse = "a"
end,
},
{
event = "neo_tree_window_after_open",
handler = function(args)
vim.opt.mouse = "a"
end,
},
{
event = "neo_tree_buffer_leave",
handler = function(arg)
vim.opt.mouse = ""
end,
},
{
event = "neo_tree_window_after_close",
handler = function(arg)
vim.opt.mouse = ""
end,
},
},
})
end,
dependencies = {
@ -50,7 +30,7 @@ return {
"MunifTanjim/nui.nvim",
},
keys = {
{ "<C-n>", ":Neotree filesystem reveal toggle reveal_force_cwd<cr>", desc = "Open NeoTree" },
{ "<C-n>", ":Neotree filesystem reveal toggle dir=%:p:h<cr>", desc = "Open NeoTree" },
},
},
}