Created base DAP installation for nvim
This commit is contained in:
		
							
								
								
									
										29
									
								
								nvim/after/plugin/dap.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								nvim/after/plugin/dap.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
				
			|||||||
 | 
					vim.keymap.set("n", "<F5>", function() require('dap').continue() end)
 | 
				
			||||||
 | 
					vim.keymap.set("n", '<leader>b', function() require('dap').toggle_breakpoint() end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					require("dap").adapters.lldb = {
 | 
				
			||||||
 | 
						type = "executable",
 | 
				
			||||||
 | 
						command = "/usr/bin/lldb-vscode", -- adjust as needed
 | 
				
			||||||
 | 
						name = "lldb",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local lldb = {
 | 
				
			||||||
 | 
						name = "Launch lldb",
 | 
				
			||||||
 | 
						type = "lldb", -- matches the adapter
 | 
				
			||||||
 | 
						request = "launch", -- could also attach to a currently running process
 | 
				
			||||||
 | 
						program = function()
 | 
				
			||||||
 | 
							return vim.fn.input(
 | 
				
			||||||
 | 
								"Path to executable: ",
 | 
				
			||||||
 | 
								vim.fn.getcwd() .. "/",
 | 
				
			||||||
 | 
								"file"
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
						cwd = "${workspaceFolder}",
 | 
				
			||||||
 | 
						stopOnEntry = false,
 | 
				
			||||||
 | 
						args = {},
 | 
				
			||||||
 | 
						runInTerminal = false,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					require('dap').configurations.rust = {
 | 
				
			||||||
 | 
						lldb -- different debuggers or more configurations can be used here
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -51,4 +51,6 @@ return require('packer').startup(function(use)
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- Debugger
 | 
				
			||||||
 | 
					    use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} }
 | 
				
			||||||
end)
 | 
					end)
 | 
				
			||||||
		Reference in New Issue
	
	Block a user