+/config
my dotfiles and nix configuration
git clone https://git.julia.blue/+/config
d0b27c7
main
1local dap =require "dap" 2 3require ( "dap-python" ). setup () 4require ( "nvim-dap-virtual-text" ). setup () 5 6dap . adapters . rr ={ type ="executable" , command ="rr" } 7dap . adapters . lldb ={ type ="executable" , command ="lldb" } 8dap . adapters . rust_lldb ={ type ="executable" , command ="rust-lldb" } 9local port =17776 10dap . adapters . codelldb ={ 11type ="server" , 12port =17776 , 13executable ={ command ="codelldb" , args ={ "--port" , 17776 } } , 14} 15dap . adapters . gdb ={ 16type ="executable" , 17command ="gdb" , 18args ={ "--interpreter=dap" , "--eval-command" , "set print pretty on" } , 19} 20dap . adapters . rust_gdb = 21{ type ="executable" , command ="rust-gdb" , args ={ "--interpreter=dap" } } 22 23dap . configurations . cpp ={ 24{ 25name ="Attach to process" , 26type ="cpp" , -- Adjust this to match your adapter name (`dap.adapters.<name>`) 27request ="attach" , 28pid =require ( "dap.utils" ). pick_process , 29args ={} , 30} , 31} 32 33local gdb_configs ={ 34launch ={ 35name ="Launch" , 36type ="gdb" , 37request ="launch" , 38program =function () 39return vim . fn . input ( "Path to executable: " , vim . fn . getcwd () .. "/" , "file" ) 40end , 41cwd ="${workspaceFolder}" , 42stopAtBeginningOfMainSubprogram =false , 43} , 44attach ={ 45name ="Select and attach to process" , 46type ="gdb" , 47request ="attach" , 48program =function () 49return vim . fn . input ( "Path to executable: " , vim . fn . getcwd () .. "/" , "file" ) 50end , 51pid =function () 52local name =vim . fn . input "Executable name (filter): " 53return require ( "dap.utils" ). pick_process { filter =name } 54end , 55cwd ="${workspaceFolder}" , 56} , 57server ={ 58name ="Attach to gdbserver :1234" , 59type ="gdb" , 60request ="attach" , 61target ="localhost:1234" , 62program =function () 63return vim . fn . input ( "Path to executable: " , vim . fn . getcwd () .. "/" , "file" ) 64end , 65cwd ="${workspaceFolder}" , 66} , 67} 68 69local lldb ={ 70name ="Launch lldb" , 71type ="lldb" , 72request ="launch" , 73program =function () 74return vim . fn . input ( "Path to executable: " , vim . fn . getcwd () .. "/" , "file" ) 75end , 76cwd ="${workspaceFolder}" , 77stopOnEntry =false , 78runInTerminal =false , 79args ={} , 80} 81 82dap . configurations . c ={ 83lldb , 84} 85dap . configurations . cpp =dap . configurations . c 86dap . configurations . rust =dap . configurations . c 87 88local function sign ( name , tbl ) 89local default ={ text ="" , texthl ="" , linehl ="" , numhl ="" } 90vim . fn . sign_define ( name , vim . tbl_extend ( "force" , default , tbl )) 91end 92 93sign ( "DapStopped" , { text ="→" , texthl ="DapStopped" } ) 94sign ( "DapLogPoint" , { text ="◆" , texthl ="DapLogPoint" } ) 95sign ( "DapBreakpoint" , { text ="●" , texthl ="DapBreakpoint" } ) 96sign ( "DapBreakpointRegected" , { text ="" , texthl ="DapBreakpointRegected" } ) 97sign ( "DapBreakpointCondition" , { text ="" , texthl ="DapBreakpointCondition" } )