mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' of https://github.com/muneebusmani/LazyVim
This commit is contained in:
commit
c3e51d739d
1 changed files with 49 additions and 0 deletions
49
lua/lazyvim/plugins/extras/util/database.lua
Normal file
49
lua/lazyvim/plugins/extras/util/database.lua
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
return {
|
||||
{
|
||||
"folke/edgy.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.opt.laststatus = 3
|
||||
vim.opt.splitkeep = "screen"
|
||||
end,
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.right, {
|
||||
title = "Database",
|
||||
ft = "dbui",
|
||||
pinned = true,
|
||||
open = "DBUI",
|
||||
size = { width = 0.25 },
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
{ "tpope/vim-dadbod", lazy = true },
|
||||
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
|
||||
},
|
||||
cmd = {
|
||||
"DBUIToggle",
|
||||
"DBUIAddConnection",
|
||||
},
|
||||
init = function()
|
||||
local wk = require("which-key")
|
||||
local dbtoggle = function()
|
||||
if _G.LazyVim.is_loaded("vim-dadbod-ui") then
|
||||
return { "<cmd>DBUIToggle<CR>", "Database Explorer", silent = true }
|
||||
else
|
||||
return { "<cmd>Lazy load vim-dadbod-ui | DBUIToggle<CR>", "Database Explorer", silent = true }
|
||||
end
|
||||
end
|
||||
wk.register({
|
||||
uD = {
|
||||
name = "Database UI",
|
||||
e = dbtoggle(),
|
||||
a = { "<cmd>DBUIAddConnection<CR>", "Add Database Connection", silent = true },
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
vim.g.db_ui_use_nerd_fonts = 1
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue