From dfe730b889915e33af1d3da810b13aa9d1d4253c Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Fri, 16 Aug 2024 09:37:25 +0200 Subject: feat: Sync --- lua/gabrielgio/dap.lua | 31 ++++++++++++++----------------- lua/gabrielgio/lsp.lua | 3 ++- lua/gabrielgio/settable.lua | 7 +++++-- lua/gabrielgio/trouble.lua | 23 +++++++++++++---------- 4 files changed, 34 insertions(+), 30 deletions(-) (limited to 'lua/gabrielgio') diff --git a/lua/gabrielgio/dap.lua b/lua/gabrielgio/dap.lua index 2534c7a..238a1bc 100644 --- a/lua/gabrielgio/dap.lua +++ b/lua/gabrielgio/dap.lua @@ -1,8 +1,5 @@ local dap = require("dap") local key = require("gabrielgio.key") -local dapgo = require("dap-go") - -dapgo.setup({delve = {build_flags = "-tags=unit,integration,e2e"}}) key.nnoremap("", ":lua require'dap'.continue()") key.nnoremap("", ":lua require'dap'.step_over()") @@ -10,23 +7,23 @@ key.nnoremap("", ":lua require'dap'.step_into()") key.nnoremap("", ":lua require'dap'.step_out()") key.nnoremap("b", ":lua require'dap'.toggle_breakpoint()") key.nnoremap("B", ":lua require'dap'.set_breakpoint(vim.fn.input('Condition: '))") -key.nnoremap("dt", ":lua require'dap-go'.debug_test()") key.nnoremap("dr", ":lua require'dap'.repl.open()") -dap.adapters.gdb = { - type = "executable", - command = "gdb", - args = { "-i", "dap" } -} +dap.adapters.delve = { + type = "server", + host = "127.0.0.1", + port = 2345, + } -dap.configurations.c = { +dap.configurations.go = { { - name = "Launch", - type = "gdb", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') - end, - cwd = "${workspaceFolder}", + type = "delve", + name = "remote", + mode = "remote", + request = "attach", + connect = { + host = "127.0.0.1", + port = "2345", + }, }, } diff --git a/lua/gabrielgio/lsp.lua b/lua/gabrielgio/lsp.lua index c8202c2..2be8b5e 100644 --- a/lua/gabrielgio/lsp.lua +++ b/lua/gabrielgio/lsp.lua @@ -35,7 +35,8 @@ load_all({ lsp_config.html.setup, lsp_config.emmet_ls.setup, lsp_config.pylsp.setup, - lsp_config.zls.setup + lsp_config.zls.setup, + lsp_config.tsserver.setup }) lsp_config.gopls.setup({ diff --git a/lua/gabrielgio/settable.lua b/lua/gabrielgio/settable.lua index bf76064..5096d3f 100644 --- a/lua/gabrielgio/settable.lua +++ b/lua/gabrielgio/settable.lua @@ -44,9 +44,12 @@ vim.opt.updatetime = 100 vim.opt.foldmethod = "expr" vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.foldenable = false -vim.cmd("colorscheme edge") vim.o.background = "light" - +if 1==1 then + vim.cmd("colorscheme edge") +else + vim.cmd("colorscheme gruvbox") +end vim.g.loaded = 1 vim.g.loaded_netrwPlugin = 1 vim.g.CtrlSpaceDefaultMappingKey = " " diff --git a/lua/gabrielgio/trouble.lua b/lua/gabrielgio/trouble.lua index 67c4938..f48fec4 100644 --- a/lua/gabrielgio/trouble.lua +++ b/lua/gabrielgio/trouble.lua @@ -1,15 +1,18 @@ +local key = require("gabrielgio.key") local trouble = require("trouble") trouble.setup{ - fold_open = "v", - fold_closed = ">", - signs = { - error = "error", - warning = "warn", - hint = "hint", - information = "info" + modes = { + test = { + mode = "diagnostics", + preview = { + type = "split", + relative = "win", + position = "right", + size = 0.3, + }, + }, }, - indent_lines = false, - icons = false, - use_diagnostic_signs = false } + +key.nnoremap("t", ":Trouble test toggle") -- cgit v1.2.3