add dadbod

This commit is contained in:
Gustavo Silva 2023-10-25 21:56:32 +02:00 committed by Gustavo Silva (es00679121_prosegur)
parent 63574e3acf
commit bbf96f56b8
4 changed files with 58 additions and 26 deletions

View File

@ -36,7 +36,7 @@ o.swapfile = false
-- Scrolling settings -- Scrolling settings
o.scrolloff = 8 o.scrolloff = 8
o.colorcolumn = '80' o.colorcolumn = '120'
o.timeoutlen = 500 o.timeoutlen = 500

View File

@ -58,7 +58,7 @@ return {
-- a string that defines the port to start delve debugger. -- a string that defines the port to start delve debugger.
-- default to string "${port}" which instructs nvim-dap -- default to string "${port}" which instructs nvim-dap
-- to start the process in a random available port -- to start the process in a random available port
port = "${port}", port = "2345",
-- additional args to pass to dlv -- additional args to pass to dlv
args = {} args = {}
}, },
@ -66,26 +66,54 @@ return {
-- Dap UI setup -- Dap UI setup
-- For more information, see |:help nvim-dap-ui| -- For more information, see |:help nvim-dap-ui|
dapui.setup() -- dapui.setup()
-- dapui.setup { dapui.setup {
-- -- Set icons to characters that are more likely to work in every terminal. -- Set icons to characters that are more likely to work in every terminal.
-- -- Feel free to remove or use ones that you like more! :) -- Feel free to remove or use ones that you like more! :)
-- -- Don't feel like these are good choices. -- Don't feel like these are good choices.
-- icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, icons = { expanded = '', collapsed = '', current_frame = '*' },
-- controls = { controls = {
-- icons = { icons = {
-- pause = '⏸', pause = '',
-- play = '▶', play = '',
-- step_into = '⏎', step_into = '',
-- step_over = '⏭', step_over = '',
-- step_out = '⏮', step_out = '',
-- step_back = 'b', step_back = 'b',
-- run_last = '▶▶', run_last = '▶▶',
-- terminate = '⏹', terminate = '',
-- disconnect = "⏏", disconnect = "",
-- }, },
-- }, },
-- } -- Layouts define sections of the screen to place windows.
-- The position can be "left", "right", "top" or "bottom".
-- The size specifies the height/width depending on position. It can be an Int
-- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
-- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
-- Elements are the elements shown in the layout (in order).
-- Layouts are opened in order so that earlier layouts take priority in window sizing.
layouts = {
{
elements = {
-- Elements can be strings or table with id and size keys.
{ id = "scopes", size = 0.25 },
"breakpoints",
"stacks",
"watches",
},
size = 40, -- 40 columns
position = "left",
},
{
elements = {
"repl",
-- "console",
},
size = 0.25, -- 25% of total lines
position = "bottom",
},
},
}
-- require('nvim-dap-virtual-text').setup() -- require('nvim-dap-virtual-text').setup()
require('mason-nvim-dap').setup { require('mason-nvim-dap').setup {
@ -121,6 +149,9 @@ return {
-- toggle to see last session result. Without this ,you can't see session output in case of unhandled exception. -- toggle to see last session result. Without this ,you can't see session output in case of unhandled exception.
vim.keymap.set("n", "<leader>tt", dapui.toggle) vim.keymap.set("n", "<leader>tt", dapui.toggle)
vim.keymap.set('n', '<leader>tr', function()
dapui.open({ reset = true })
end, { desc = 'dap reset ui' })
dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.after.event_initialized['dapui_config'] = dapui.open
-- dap.listeners.before.event_terminated['dapui_config'] = dapui.close -- dap.listeners.before.event_terminated['dapui_config'] = dapui.close
-- dap.listeners.before.event_exited['dapui_config'] = dapui.close -- dap.listeners.before.event_exited['dapui_config'] = dapui.close

View File

@ -9,10 +9,11 @@ return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
}, },
config = function() config = function()
-- local gofmt = require("go.format")
require("go").setup() require("go").setup()
-- vim.keymap.set('n', 'gF', gofmt.goimport, { desc = 'Go Import' }) local gofmt = require("go.format")
vim.keymap.set('n', 'gF', gofmt.goimport, { desc = 'Go Import' })
end, end,
event = { "CmdlineEnter" }, event = { "CmdlineEnter" },
ft = { "go", 'gomod' }, ft = { "go", 'gomod' },

View File

@ -7,8 +7,8 @@ return {
null_ls.setup { null_ls.setup {
sources = { sources = {
null_ls.builtins.formatting.goimports_reviser, -- null_ls.builtins.formatting.goimports_reviser,
-- null_ls.builtins.formatting.gofumpt, null_ls.builtins.formatting.gofumpt,
-- null_ls.builtins.formatting.golines, -- null_ls.builtins.formatting.golines,
}, },
on_attach = function(client, bufnr) on_attach = function(client, bufnr)