mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-25 18:28:44 +02:00
Updated 7. Example Custom Plugins (markdown)
parent
6d99293910
commit
6f718e517c
1 changed files with 57 additions and 0 deletions
|
@ -2819,3 +2819,60 @@ return {
|
|||
},
|
||||
}
|
||||
```
|
||||
# Database Management
|
||||
```lua
|
||||
return {
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
{ "tpope/vim-dadbod", lazy = true },
|
||||
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
|
||||
},
|
||||
init = function()
|
||||
-- Your DBUI configuration
|
||||
vim.g.db_ui_show_database_icon = 1
|
||||
vim.g.db_ui_use_nerd_fonts = 1
|
||||
vim.g.db_ui_show_help = 0
|
||||
end,
|
||||
config = function()
|
||||
local function db_completion()
|
||||
require("cmp").setup.buffer {
|
||||
sources = { { name = "vim-dadbod-completion" } },
|
||||
}
|
||||
end
|
||||
vim.g.db_ui_save_location = vim.fn.stdpath "config" .. require("plenary.path").path.sep .. "db_ui"
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"sql",
|
||||
},
|
||||
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"sql",
|
||||
"mysql",
|
||||
"plsql",
|
||||
},
|
||||
callback = function()
|
||||
vim.schedule(db_completion)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
cmd = {
|
||||
"DBUIToggle",
|
||||
"DBUI",
|
||||
"DBUIAddConnection",
|
||||
"DBUIFindBuffer",
|
||||
"DBUIRenameBuffer",
|
||||
"DBUILastQueryInfo",
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
|
||||
"<leader>D",
|
||||
"<cmd>NvimTreeClose<cr><cmd>tabnew<cr><bar><bar><cmd>DBUI<cr>",
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue