updated configuration

This commit is contained in:
2026-01-12 23:12:11 -07:00
parent 6d79fde026
commit dc98d50a31
14 changed files with 1219 additions and 224 deletions

View File

@@ -1,10 +1,14 @@
-- AI Chat Integration using avante.nvim
-- Supports: Anthropic Claude, OpenAI, Google Gemini, Copilot, and more
-- API keys via environment variables:
-- ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY
-- Or scoped: AVANTE_ANTHROPIC_API_KEY, AVANTE_OPENAI_API_KEY, etc.
return {
-- Avante: Cursor-like AI assistant
{
"yetone/avante.nvim",
event = "VeryLazy",
lazy = false,
version = false,
version = false, -- Never set to "*"
build = "make",
dependencies = {
"nvim-treesitter/nvim-treesitter",
@@ -12,49 +16,180 @@ return {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"nvim-tree/nvim-web-devicons",
"zbirenbaum/copilot.lua", -- Optional for copilot suggestions
{
-- Image support (optional)
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
opts = {
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = { insert_mode = true },
drag_and_drop = {
insert_mode = true,
},
},
},
},
{
-- Markdown rendering in Avante
"MeanderingProgrammer/render-markdown.nvim",
opts = { file_types = { "markdown", "Avante" } },
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
---@module 'avante'
---@type avante.Config
opts = {
debug = true,
-- Default provider (switch with :AvanteProvider command)
-- Options: "claude", "openai", "azure", "gemini", "copilot", "cohere"
provider = "claude",
mode = "agentic",
auto_suggestions_provider = "copilot",
-- Provider configurations
providers = {
claude = {
model = "claude-sonnet-4-5",
endpoint = "https://api.anthropic.com",
model = "claude-sonnet-4-5-20250929",
timeout = 30000,
extra_request_body = {
temperature = 0.75,
max_tokens = 20480,
},
},
openai = {
endpoint = "https://api.openai.com/v1",
model = "gpt-4o",
timeout = 30000,
extra_request_body = {
temperature = 0.75,
max_completion_tokens = 16384,
},
},
azure = {
endpoint = "", -- e.g., "https://<resource>.openai.azure.com"
deployment = "", -- Azure deployment name
api_version = "2024-12-01-preview",
timeout = 30000,
extra_request_body = {
temperature = 0.75,
max_completion_tokens = 16384,
},
},
gemini = {
endpoint = "https://generativelanguage.googleapis.com/v1beta/models",
model = "gemini-2.0-flash",
timeout = 30000,
extra_request_body = {
generationConfig = {
temperature = 0.75,
},
},
},
copilot = {
endpoint = "https://api.githubcopilot.com",
model = "gpt-4o-2024-08-06",
timeout = 30000,
extra_request_body = {
temperature = 0.75,
max_tokens = 20480,
},
},
-- Custom provider example for Ollama (local models)
-- Uncomment and configure if using local LLMs
-- ollama = {
-- __inherited_from = "openai",
-- endpoint = "http://localhost:11434/v1",
-- model = "llama3.2",
-- api_key_name = "",
-- },
},
-- Behavior settings
behaviour = {
auto_seggestions = true,
auto_suggestions = false, -- Set true for copilot-like suggestions
auto_set_highlight_group = true,
auto_set_keymaps = true,
auto_apply_diff_after_generation = false,
support_paste_from_clipboard = false,
minimize_diff = true,
enable_token_counting = true,
},
-- Mappings
mappings = {
ask = "<leader>aa",
edit = "<leader>ae",
refresh = "<leader>ar",
toggle = {
default = "<leader>at",
debug = "<leader>ad",
hint = "<leader>ah",
diff = {
ours = "co",
theirs = "ct",
all_theirs = "ca",
both = "cb",
cursor = "cc",
next = "]x",
prev = "[x",
},
suggestion = {
accept = "<M-l>",
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
jump = {
next = "]]",
prev = "[[",
},
submit = {
normal = "<CR>",
insert = "<C-s>",
},
sidebar = {
apply_all = "A",
apply_cursor = "a",
switch_windows = "<Tab>",
reverse_switch_windows = "<S-Tab>",
},
},
-- Hints shown in the UI
hints = { enabled = true },
-- Window configuration
windows = {
position = "right",
wrap = true,
width = 30,
sidebar_header = {
enabled = true,
align = "center",
rounded = true,
},
input = {
prefix = "> ",
height = 8,
},
edit = {
border = "rounded",
start_insert = true,
},
ask = {
floating = false,
start_insert = true,
border = "rounded",
},
},
-- Highlight groups
highlights = {
diff = {
current = "DiffText",
incoming = "DiffAdd",
},
},
-- Diff settings
diff = {
autojump = true,
list_opener = "copen",
override_timeoutlen = 500,
},
},
},

83
lua/plugins/dadbod.lua Normal file
View File

@@ -0,0 +1,83 @@
-- Database integration with vim-dadbod
-- Supports PostgreSQL, MySQL, SQLite, and more
return {
-- Core dadbod plugin
{
"tpope/vim-dadbod",
cmd = { "DB", "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" },
},
-- UI for dadbod
{
"kristijanhusak/vim-dadbod-ui",
cmd = { "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" },
dependencies = {
{ "tpope/vim-dadbod", lazy = true },
},
init = function()
-- UI configuration
vim.g.db_ui_use_nerd_fonts = 1
vim.g.db_ui_show_database_icon = 1
vim.g.db_ui_force_echo_notifications = 1
-- Save location for connections
vim.g.db_ui_save_location = vim.fn.stdpath("data") .. "/db_ui"
-- Execute on save
vim.g.db_ui_execute_on_save = 0
-- Icons
vim.g.db_ui_icons = {
expanded = "",
collapsed = "",
saved_query = "*",
new_query = "+",
tables = "~",
buffers = "»",
connection_ok = "",
connection_error = "",
}
end,
},
-- Autocompletion for dadbod
{
"kristijanhusak/vim-dadbod-completion",
dependencies = {
"tpope/vim-dadbod",
"hrsh7th/nvim-cmp",
},
ft = { "sql", "mysql", "plsql" },
init = function()
-- Setup completion for SQL files
vim.api.nvim_create_autocmd("FileType", {
pattern = { "sql", "mysql", "plsql" },
callback = function()
local cmp = require("cmp")
local sources = cmp.get_config().sources or {}
-- Add dadbod completion source
table.insert(sources, { name = "vim-dadbod-completion" })
cmp.setup.buffer({
sources = cmp.config.sources(sources),
})
end,
})
end,
},
-- Add dadbod-completion to nvim-cmp sources
{
"hrsh7th/nvim-cmp",
optional = true,
dependencies = {
"kristijanhusak/vim-dadbod-completion",
},
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, { name = "vim-dadbod-completion" })
end,
},
}

View File

@@ -1,65 +1,158 @@
-- Debug Adapter Protocol (DAP) configuration for Go
-- Uses delve for Go debugging
return {
-- Ensure Mason installs debug adapters
{
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"delve", -- Go debugger
"debugpy", -- Python debugger
"js-debug-adapter", -- JS/TS debugger
},
},
},
-- Mason DAP bridge - auto-configures adapters
{
"jay-babu/mason-nvim-dap.nvim",
dependencies = { "mason-org/mason.nvim", "mfussenegger/nvim-dap" },
opts = {
ensure_installed = { "delve", "debugpy", "js" },
automatic_installation = true,
handlers = {},
},
},
-- nvim-dap configuration
{
"mfussenegger/nvim-dap",
dependencies = {
"jay-babu/mason-nvim-dap.nvim",
-- Go-specific DAP configuration
{
"leoluz/nvim-dap-go",
opts = {},
},
{
"mfussenegger/nvim-dap-python",
config = function()
local mason_path = vim.fn.stdpath("data") .. "/mason/packages/debugpy/venv/bin/python"
require("dap-python").setup(mason_path)
end,
opts = {
-- Delve configurations
delve = {
-- Path to delve (uses Mason-installed by default)
path = "dlv",
-- Initialize with default args
initialize_timeout_sec = 20,
-- Whether to use debug adapter mode
port = "${port}",
-- Build flags for delve
build_flags = "",
},
-- DAP configurations for Go
dap_configurations = {
{
type = "go",
name = "Debug",
request = "launch",
program = "${file}",
},
{
type = "go",
name = "Debug Package",
request = "launch",
program = "${fileDirname}",
},
{
type = "go",
name = "Debug test",
request = "launch",
mode = "test",
program = "${file}",
},
{
type = "go",
name = "Debug test (go.mod)",
request = "launch",
mode = "test",
program = "./${relativeFileDirname}",
},
{
type = "go",
name = "Attach",
request = "attach",
mode = "local",
processId = require("dap.utils").pick_process,
},
},
},
},
},
keys = {
-- Debug keymaps
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end, desc = "Breakpoint Condition" },
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to Line (No Execute)" },
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
-- Go-specific
{ "<leader>dT", function() require("dap-go").debug_test() end, desc = "Debug Go Test" },
{ "<leader>dL", function() require("dap-go").debug_last_test() end, desc = "Debug Last Go Test" },
},
},
-- DAP UI for better debugging experience
{
"rcarriga/nvim-dap-ui",
dependencies = { "nvim-neotest/nvim-nio" },
dependencies = {
"mfussenegger/nvim-dap",
"nvim-neotest/nvim-nio",
},
keys = {
{
"<leader>du",
function()
require("dapui").toggle()
end,
desc = "DAP UI",
},
{
"<leader>de",
function()
require("dapui").eval()
end,
desc = "Eval",
mode = { "n", "v" },
{ "<leader>du", function() require("dapui").toggle({}) end, desc = "Dap UI" },
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = { "n", "v" } },
},
opts = {
layouts = {
{
elements = {
{ id = "scopes", size = 0.25 },
{ id = "breakpoints", size = 0.25 },
{ id = "stacks", size = 0.25 },
{ id = "watches", size = 0.25 },
},
position = "left",
size = 40,
},
{
elements = {
{ id = "repl", size = 0.5 },
{ id = "console", size = 0.5 },
},
position = "bottom",
size = 10,
},
},
},
opts = {},
config = function(_, opts)
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
-- Auto open/close DAP UI
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open({})
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close({})
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close({})
end
end,
},
-- Virtual text for debugging
{
"theHamsta/nvim-dap-virtual-text",
opts = {
enabled = true,
enabled_commands = true,
highlight_changed_variables = true,
highlight_new_as_changed = false,
show_stop_reason = true,
commented = false,
only_first_definition = true,
all_references = false,
filter_references_pattern = "<module",
virt_text_pos = "eol",
all_frames = false,
virt_lines = false,
virt_text_win_col = nil,
},
},
}

View File

@@ -1,78 +1,89 @@
-- Editor enhancements - Snacks explorer configuration
-- Custom keybindings for file explorer (snacks.nvim built into LazyVim)
return {
-- Telescope: show gitignored files
{
"nvim-telescope/telescope.nvim",
opts = {
defaults = {
file_ignore_patterns = {}, -- Don't ignore anything by default
},
pickers = {
find_files = {
hidden = true,
no_ignore = true, -- Include .gitignore files
},
live_grep = {
additional_args = function()
return { "--hidden", "--no-ignore" }
end,
},
},
},
keys = {
-- Override default to include hidden/ignored
{ "<leader>ff", "<cmd>Telescope find_files hidden=true no_ignore=true<cr>", desc = "Find Files (all)" },
{ "<leader>fF", "<cmd>Telescope find_files<cr>", desc = "Find Files (respect gitignore)" },
},
},
-- Configure snacks.nvim explorer (already included in LazyVim)
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
version = false,
---@module 'snacks'
---@type snacks.Config
opts = {
picker = {
hidden = true,
ignored = true,
live = true,
sources = {
files = {
hidden = true,
ignored = true,
},
},
},
explorer = {
ignored = true,
hidden = true,
replace_netrw = true,
},
styles = {
notification = {
wo = {
wrap = true,
picker = {
sources = {
explorer = {
-- Explorer picker configuration
hidden = true,
ignored = true, -- Show files ignored by .gitignore
follow_file = true,
-- Custom keymaps within the explorer
win = {
list = {
keys = {
-- Ctrl+Shift+v - Open in vertical split
["<C-S-v>"] = { "edit_vsplit", mode = { "n", "i" } },
-- Ctrl+Shift+h - Open in horizontal split
["<C-S-h>"] = { "edit_split", mode = { "n", "i" } },
-- Alternative mappings (in case terminal doesn't send Ctrl+Shift properly)
["<C-v>"] = { "edit_vsplit", mode = { "n", "i" } },
["<C-x>"] = { "edit_split", mode = { "n", "i" } },
},
},
},
},
},
},
},
},
{
"folke/todo-comments.nvim",
optional = true,
keys = {
{
"<leader>st",
function()
Snacks.picker.todo_comments()
end,
desc = "Todo",
-- Ctrl+Shift+e - Toggle explorer
{ "<C-S-e>", function() Snacks.explorer() end, desc = "Toggle Explorer" },
-- Alternative binding if terminal doesn't handle Ctrl+Shift
{ "<leader>fe", function() Snacks.explorer() end, desc = "File Explorer" },
},
},
-- Which-key for keybinding hints
{
"folke/which-key.nvim",
opts = {
spec = {
{ "<leader>a", group = "AI" },
{ "<leader>d", group = "Debug/Database" },
{ "<leader>t", group = "Terminal" },
},
{
"<leader>sT",
function()
Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } })
end,
desc = "Todo/Fix/Fixme",
},
},
-- Better terminal integration
{
"akinsho/toggleterm.nvim",
version = "*",
opts = {
size = function(term)
if term.direction == "horizontal" then
return 15
elseif term.direction == "vertical" then
return vim.o.columns * 0.4
end
end,
open_mapping = [[<c-\>]],
hide_numbers = true,
shade_filetypes = {},
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persist_size = true,
direction = "float",
close_on_exit = true,
shell = vim.o.shell,
float_opts = {
border = "curved",
winblend = 0,
highlights = {
border = "Normal",
background = "Normal",
},
},
},
},

137
lua/plugins/formatting.lua Normal file
View File

@@ -0,0 +1,137 @@
-- Formatting configuration with conform.nvim
-- Autoformat on save with per-filetype formatters
return {
{
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
keys = {
{
"<leader>cf",
function()
require("conform").format({ async = true, lsp_fallback = true })
end,
mode = { "n", "v" },
desc = "Format buffer",
},
},
opts = {
-- Formatters by filetype
formatters_by_ft = {
-- Go
go = { "gofumpt", "goimports" },
-- Lua
lua = { "stylua" },
-- JavaScript/TypeScript
javascript = { "prettier" },
javascriptreact = { "prettier" },
typescript = { "prettier" },
typescriptreact = { "prettier" },
-- Web
html = { "prettier" },
css = { "prettier" },
scss = { "prettier" },
-- Data formats
json = { "prettier" },
jsonc = { "prettier" },
yaml = { "prettier" },
-- Markdown
markdown = { "prettier" },
["markdown.mdx"] = { "prettier" },
-- SQL
sql = { "sql_formatter" },
mysql = { "sql_formatter" },
plsql = { "sql_formatter" },
-- Makefile (no formatter - they require tabs)
-- make = {},
-- Fallback for all other filetypes
["_"] = { "trim_whitespace" },
},
-- Format on save
format_on_save = function(bufnr)
-- Disable for certain filetypes
local ignore_filetypes = { "sql", "mysql", "plsql" }
if vim.tbl_contains(ignore_filetypes, vim.bo[bufnr].filetype) then
return
end
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return {
timeout_ms = 3000,
lsp_fallback = true,
}
end,
-- Formatter options
formatters = {
-- Stylua configuration
stylua = {
prepend_args = { "--indent-type", "Spaces", "--indent-width", "2" },
},
-- Prettier configuration
prettier = {
prepend_args = { "--tab-width", "2", "--single-quote" },
},
-- SQL formatter configuration
sql_formatter = {
prepend_args = { "--language", "postgresql" },
},
-- goimports configuration
goimports = {
prepend_args = { "-local", "github.com" },
},
},
},
init = function()
-- Commands to toggle format on save
vim.api.nvim_create_user_command("FormatDisable", function(args)
if args.bang then
-- FormatDisable! will disable formatting just for this buffer
vim.b.disable_autoformat = true
else
vim.g.disable_autoformat = true
end
vim.notify("Autoformat disabled", vim.log.levels.INFO)
end, {
desc = "Disable autoformat-on-save",
bang = true,
})
vim.api.nvim_create_user_command("FormatEnable", function()
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false
vim.notify("Autoformat enabled", vim.log.levels.INFO)
end, {
desc = "Re-enable autoformat-on-save",
})
vim.api.nvim_create_user_command("FormatToggle", function()
vim.g.disable_autoformat = not vim.g.disable_autoformat
if vim.g.disable_autoformat then
vim.notify("Autoformat disabled", vim.log.levels.INFO)
else
vim.notify("Autoformat enabled", vim.log.levels.INFO)
end
end, {
desc = "Toggle autoformat-on-save",
})
end,
},
}

194
lua/plugins/lsp.lua Normal file
View File

@@ -0,0 +1,194 @@
-- LSP Configuration
-- Extends LazyVim's built-in LSP support
return {
-- Mason: manage LSP servers, linters, formatters
{
"mason-org/mason.nvim",
opts = {
ensure_installed = {
-- LSP servers
"gopls", -- Go
"lua-language-server", -- Lua
"typescript-language-server", -- TypeScript/JavaScript
"html-lsp", -- HTML
"css-lsp", -- CSS
"json-lsp", -- JSON
"yaml-language-server", -- YAML
"marksman", -- Markdown
"sqlls", -- SQL
-- Linters
"golangci-lint",
"eslint_d",
"markdownlint",
-- Formatters
"gofumpt",
"goimports",
"prettier",
"stylua",
"sql-formatter",
-- DAP
"delve", -- Go debugger
},
},
},
-- LSP configuration
{
"neovim/nvim-lspconfig",
opts = {
servers = {
-- Go
gopls = {
settings = {
gopls = {
gofumpt = true,
codelenses = {
gc_details = false,
generate = true,
regenerate_cgo = true,
run_govulncheck = true,
test = true,
tidy = true,
upgrade_dependency = true,
vendor = true,
},
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true,
},
analyses = {
fieldalignment = true,
nilness = true,
unusedparams = true,
unusedwrite = true,
useany = true,
},
usePlaceholders = true,
completeUnimported = true,
staticcheck = true,
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
semanticTokens = true,
},
},
},
-- Lua
lua_ls = {
settings = {
Lua = {
workspace = {
checkThirdParty = false,
},
completion = {
callSnippet = "Replace",
},
diagnostics = {
globals = { "vim" },
},
},
},
},
-- TypeScript/JavaScript
ts_ls = {
settings = {
typescript = {
inlayHints = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
},
javascript = {
inlayHints = {
includeInlayParameterNameHints = "all",
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
},
},
},
-- HTML
html = {
filetypes = { "html", "templ" },
},
-- CSS
cssls = {},
-- JSON
jsonls = {},
-- YAML
yamlls = {
settings = {
yaml = {
keyOrdering = false,
schemas = {
["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
["https://json.schemastore.org/docker-compose.json"] = "docker-compose*.yml",
},
},
},
},
-- Markdown
marksman = {},
-- SQL
sqlls = {},
},
},
},
-- Treesitter for better syntax highlighting
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"go",
"gomod",
"gowork",
"gosum",
"lua",
"luadoc",
"typescript",
"javascript",
"tsx",
"html",
"css",
"json",
"jsonc",
"yaml",
"markdown",
"markdown_inline",
"sql",
"make",
"vim",
"vimdoc",
"bash",
"regex",
"diff",
"gitcommit",
"git_rebase",
},
highlight = { enable = true },
indent = { enable = true },
},
},
}

View File

@@ -1,40 +0,0 @@
return {
-- vim-dadbod with project-local connections
{
"kristijanhusak/vim-dadbod-ui",
dependencies = {
{ "tpope/vim-dadbod", lazy = true },
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
},
cmd = { "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" },
init = function()
vim.g.db_ui_use_nerd_fonts = 1
-- Use project-local connection file
vim.g.db_ui_save_location = vim.fn.getcwd() .. "/.db"
-- Or look for a dadbod.json in project root
vim.g.db_ui_env_variable_url = "DATABASE_URL"
vim.g.db_ui_env_variable_name = "DATABASE_NAME"
-- Auto-load connections from .dadbod.json if it exists
local project_db_config = vim.fn.getcwd() .. "/.dadbod.json"
if vim.fn.filereadable(project_db_config) == 1 then
vim.g.dbs = vim.fn.json_decode(vim.fn.readfile(project_db_config))
end
end,
keys = {
{ "<leader>D", "<cmd>DBUIToggle<CR>", desc = "Toggle DBUI" },
},
},
{
"hrsh7th/nvim-cmp",
optional = true,
dependencies = { "kristijanhusak/vim-dadbod-completion" },
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, { name = "vim-dadbod-completion" })
end,
},
}