updated configuration
This commit is contained in:
@@ -1,8 +1,108 @@
|
||||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
--
|
||||
-- Add any additional autocmds here
|
||||
-- with `vim.api.nvim_create_autocmd`
|
||||
--
|
||||
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
|
||||
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
|
||||
-- Autocommands
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
-- Highlight on yank
|
||||
augroup("YankHighlight", { clear = true })
|
||||
autocmd("TextYankPost", {
|
||||
group = "YankHighlight",
|
||||
callback = function()
|
||||
vim.highlight.on_yank({ higroup = "IncSearch", timeout = 200 })
|
||||
end,
|
||||
})
|
||||
|
||||
-- Resize splits when window is resized
|
||||
augroup("ResizeSplits", { clear = true })
|
||||
autocmd("VimResized", {
|
||||
group = "ResizeSplits",
|
||||
callback = function()
|
||||
vim.cmd("tabdo wincmd =")
|
||||
end,
|
||||
})
|
||||
|
||||
-- Go to last location when opening a buffer
|
||||
augroup("LastLocation", { clear = true })
|
||||
autocmd("BufReadPost", {
|
||||
group = "LastLocation",
|
||||
callback = function(event)
|
||||
local exclude = { "gitcommit" }
|
||||
local buf = event.buf
|
||||
if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].lazyvim_last_loc then
|
||||
return
|
||||
end
|
||||
vim.b[buf].lazyvim_last_loc = true
|
||||
local mark = vim.api.nvim_buf_get_mark(buf, '"')
|
||||
local lcount = vim.api.nvim_buf_line_count(buf)
|
||||
if mark[1] > 0 and mark[1] <= lcount then
|
||||
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Close certain filetypes with q
|
||||
augroup("CloseWithQ", { clear = true })
|
||||
autocmd("FileType", {
|
||||
group = "CloseWithQ",
|
||||
pattern = {
|
||||
"help",
|
||||
"lspinfo",
|
||||
"man",
|
||||
"notify",
|
||||
"qf",
|
||||
"spectre_panel",
|
||||
"startuptime",
|
||||
"checkhealth",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
|
||||
end,
|
||||
})
|
||||
|
||||
-- Auto create parent directories when saving
|
||||
augroup("AutoCreateDir", { clear = true })
|
||||
autocmd("BufWritePre", {
|
||||
group = "AutoCreateDir",
|
||||
callback = function(event)
|
||||
if event.match:match("^%w%w+://") then
|
||||
return
|
||||
end
|
||||
local file = vim.uv.fs_realpath(event.match) or event.match
|
||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
})
|
||||
|
||||
-- Set specific options for certain filetypes
|
||||
augroup("FileTypeSettings", { clear = true })
|
||||
|
||||
-- Go files: use tabs
|
||||
autocmd("FileType", {
|
||||
group = "FileTypeSettings",
|
||||
pattern = "go",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = false
|
||||
vim.opt_local.tabstop = 4
|
||||
vim.opt_local.shiftwidth = 4
|
||||
end,
|
||||
})
|
||||
|
||||
-- Makefile: use tabs
|
||||
autocmd("FileType", {
|
||||
group = "FileTypeSettings",
|
||||
pattern = "make",
|
||||
callback = function()
|
||||
vim.opt_local.expandtab = false
|
||||
vim.opt_local.tabstop = 4
|
||||
vim.opt_local.shiftwidth = 4
|
||||
end,
|
||||
})
|
||||
|
||||
-- Markdown: enable wrap
|
||||
autocmd("FileType", {
|
||||
group = "FileTypeSettings",
|
||||
pattern = "markdown",
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -1,13 +1,70 @@
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
-- Custom keymaps
|
||||
local map = vim.keymap.set
|
||||
|
||||
vim.keymap.set("n", "<leader>th", function()
|
||||
vim.cmd("lcd %:p:h")
|
||||
-- Terminal keymaps
|
||||
-- <leader>th - Open terminal in horizontal split
|
||||
map("n", "<leader>th", function()
|
||||
vim.cmd("split | terminal")
|
||||
end, { desc = "Terminal (horizontal)" })
|
||||
vim.cmd("startinsert")
|
||||
end, { desc = "Terminal (horizontal split)" })
|
||||
|
||||
vim.keymap.set("n", "<leader>tv", function()
|
||||
vim.cmd("lcd %:p:h")
|
||||
-- <leader>tv - Open terminal in vertical split
|
||||
map("n", "<leader>tv", function()
|
||||
vim.cmd("vsplit | terminal")
|
||||
end, { desc = "Terminal (vertical)" })
|
||||
vim.cmd("startinsert")
|
||||
end, { desc = "Terminal (vertical split)" })
|
||||
|
||||
-- Terminal mode: Escape to normal mode
|
||||
map("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
|
||||
|
||||
-- Explorer keymaps (Snacks explorer)
|
||||
-- Ctrl+Shift+e - Toggle explorer
|
||||
map("n", "<C-S-e>", function() Snacks.explorer() end, { desc = "Toggle Explorer" })
|
||||
map("i", "<C-S-e>", function() Snacks.explorer() end, { desc = "Toggle Explorer" })
|
||||
|
||||
-- Note: Ctrl+Shift+v and Ctrl+Shift+h for opening files in splits
|
||||
-- are configured in the snacks picker config (lua/plugins/editor.lua)
|
||||
-- as they need to work within the explorer buffer context
|
||||
|
||||
-- Additional useful keymaps
|
||||
-- Better window navigation
|
||||
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window" })
|
||||
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window" })
|
||||
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window" })
|
||||
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window" })
|
||||
|
||||
-- Resize windows with arrows
|
||||
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
|
||||
map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease window height" })
|
||||
map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease window width" })
|
||||
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase window width" })
|
||||
|
||||
-- Buffer navigation
|
||||
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
|
||||
map("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next buffer" })
|
||||
|
||||
-- Clear search highlight
|
||||
map("n", "<Esc>", "<cmd>nohlsearch<cr>", { desc = "Clear search highlight" })
|
||||
|
||||
-- Save file
|
||||
map({ "n", "i", "v", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
|
||||
|
||||
-- Better indenting in visual mode
|
||||
map("v", "<", "<gv")
|
||||
map("v", ">", ">gv")
|
||||
|
||||
-- Move lines up/down
|
||||
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move line down" })
|
||||
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move line up" })
|
||||
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move selection down" })
|
||||
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move selection up" })
|
||||
|
||||
-- Quick access to AI chat
|
||||
map("n", "<leader>aa", "<cmd>AvanteAsk<cr>", { desc = "AI Ask" })
|
||||
map("v", "<leader>aa", "<cmd>AvanteAsk<cr>", { desc = "AI Ask (selection)" })
|
||||
map("n", "<leader>ac", "<cmd>AvanteChat<cr>", { desc = "AI Chat" })
|
||||
map("n", "<leader>at", "<cmd>AvanteToggle<cr>", { desc = "AI Toggle" })
|
||||
|
||||
-- Database keymaps
|
||||
map("n", "<leader>db", "<cmd>DBUIToggle<cr>", { desc = "Toggle DB UI" })
|
||||
map("n", "<leader>da", "<cmd>DBUIAddConnection<cr>", { desc = "Add DB Connection" })
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
@@ -14,45 +15,46 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Set leader keys before loading plugins
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim with LazyVim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
|
||||
-- Language support (these enable LSP, formatting, linting & DAP)
|
||||
-- Import LazyVim and its plugins
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
import = "lazyvim.plugins",
|
||||
opts = {
|
||||
colorscheme = "tokyonight",
|
||||
},
|
||||
},
|
||||
-- Import LazyVim extras for languages
|
||||
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
{ import = "lazyvim.plugins.extras.lang.yaml" },
|
||||
{ import = "lazyvim.plugins.extras.lang.markdown" },
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
|
||||
-- DAP (Debug Adapter Protocol)
|
||||
-- DAP for debugging
|
||||
{ import = "lazyvim.plugins.extras.dap.core" },
|
||||
-- import/override with your plugins
|
||||
-- Import custom plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||
lazy = false,
|
||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||
-- have outdated releases, which may break your Neovim install.
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
version = false,
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
checker = {
|
||||
enabled = true, -- check for plugin updates periodically
|
||||
notify = false, -- notify on update
|
||||
}, -- automatically check for plugin updates
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
@@ -61,3 +63,8 @@ require("lazy").setup({
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Load custom config
|
||||
require("config.options")
|
||||
require("config.keymaps")
|
||||
require("config.autocmds")
|
||||
|
||||
@@ -1,3 +1,47 @@
|
||||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
-- Add any additional options here
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
-- General
|
||||
opt.clipboard = "unnamedplus" -- Sync with system clipboard
|
||||
opt.confirm = true -- Confirm before closing unsaved buffer
|
||||
opt.cursorline = true -- Highlight current line
|
||||
opt.mouse = "a" -- Enable mouse
|
||||
opt.number = true -- Show line numbers
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.signcolumn = "yes" -- Always show sign column
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.wrap = false -- Disable line wrap
|
||||
|
||||
-- Indentation
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.shiftwidth = 2 -- Size of indent
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.smartindent = true -- Smart indentation
|
||||
|
||||
-- Search
|
||||
opt.ignorecase = true -- Ignore case
|
||||
opt.smartcase = true -- Don't ignore case with capitals
|
||||
opt.hlsearch = true -- Highlight search results
|
||||
opt.incsearch = true -- Show search results as you type
|
||||
|
||||
-- Split behavior
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
|
||||
-- Undo
|
||||
opt.undofile = true -- Persistent undo
|
||||
opt.undolevels = 10000 -- Maximum undo levels
|
||||
|
||||
-- Performance
|
||||
opt.updatetime = 200 -- Faster completion
|
||||
opt.timeoutlen = 300 -- Faster key sequence completion
|
||||
|
||||
-- Completion
|
||||
opt.completeopt = "menu,menuone,noselect"
|
||||
|
||||
-- Folding (using treesitter)
|
||||
opt.foldmethod = "expr"
|
||||
opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
opt.foldlevel = 99 -- Start with all folds open
|
||||
|
||||
@@ -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
83
lua/plugins/dadbod.lua
Normal 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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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
137
lua/plugins/formatting.lua
Normal 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
194
lua/plugins/lsp.lua
Normal 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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user