♻️ refactor(nvim): extended lang extras of lazyvim included langs
This commit is contained in:
parent
fa3d2ca31f
commit
983b5fb5c9
8 changed files with 98 additions and 256 deletions
12
.config/nvim/lua/plugins/extras/lang/git-extended.lua
Normal file
12
.config/nvim/lua/plugins/extras/lang/git-extended.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.git" },
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"git",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitattributes",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"git",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
20
.config/nvim/lua/plugins/extras/lang/nix-extended.lua
Normal file
20
.config/nvim/lua/plugins/extras/lang/nix-extended.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.nix" },
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft.nix = opts.linters_by_ft.nix or {}
|
||||
table.insert(opts.linters_by_ft.nix, "statix")
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"nix",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"nix",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"nil",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
nil_ls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.formatters_by_ft.nix = opts.formatters_by_ft.nix or {}
|
||||
table.insert(opts.formatters_by_ft.nix, "alejandra")
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft.nix = opts.linters_by_ft.nix or {}
|
||||
table.insert(opts.linters_by_ft.nix, "statix")
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"nix",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
52
.config/nvim/lua/plugins/extras/lang/sql-extended.lua
Normal file
52
.config/nvim/lua/plugins/extras/lang/sql-extended.lua
Normal file
|
@ -0,0 +1,52 @@
|
|||
local sql_ft = { "sql", "mysql", "plsql" }
|
||||
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
{
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
{ "jsborjesson/vim-uppercase-sql", ft = sql_ft },
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>Da", "<cmd>DBUIAddConnection<cr>", desc = "Add Connection" },
|
||||
{ "<leader>Du", "<cmd>DBUIToggle<cr>", desc = "Toggle UI" },
|
||||
{ "<leader>Df", "<cmd>DBUIFindBuffer<cr>", desc = "Find Buffer" },
|
||||
{ "<leader>Dr", "<cmd>DBUIRenameBuffer<cr>", desc = "Rename Buffer" },
|
||||
{ "<leader>Dq", "<cmd>DBUILastQueryInfo<cr>", desc = "Last Query Info" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>D"] = { name = " database" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"sqlls",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
sqlls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"sqlite",
|
||||
"postgresql-16",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,144 +0,0 @@
|
|||
local sql_ft = { "sql", "mysql", "plsql" }
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "sql" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/edgy.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.right = opts.right or {}
|
||||
table.insert(opts.right, {
|
||||
title = "Database",
|
||||
ft = "dbui",
|
||||
pinned = true,
|
||||
open = function()
|
||||
vim.cmd("DBUI")
|
||||
end,
|
||||
})
|
||||
|
||||
opts.bottom = opts.bottom or {}
|
||||
table.insert(opts.bottom, {
|
||||
title = "DB Query Result",
|
||||
ft = "dbout",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = function(_, opts)
|
||||
local autocomplete_group = vim.api.nvim_create_augroup("vimrc_autocompletion", { clear = true })
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = sql_ft,
|
||||
callback = function()
|
||||
table.insert(opts.sources, { name = "vim-dadbod-completion" })
|
||||
end,
|
||||
group = autocomplete_group,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"tpope/vim-dadbod",
|
||||
cmd = { "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" },
|
||||
dependencies = {
|
||||
{ "kristijanhusak/vim-dadbod-ui" },
|
||||
{ "kristijanhusak/vim-dadbod-completion", ft = sql_ft },
|
||||
{ "jsborjesson/vim-uppercase-sql", ft = sql_ft },
|
||||
},
|
||||
config = function()
|
||||
vim.g.db_ui_save_location = vim.fn.stdpath("data") .. "/db_ui"
|
||||
vim.g.db_ui_use_nerd_fonts = true
|
||||
vim.g.db_ui_execute_on_save = false
|
||||
vim.g.db_ui_use_nvim_notify = true
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>Da", "<cmd>DBUIAddConnection<cr>", desc = "Add Connection" },
|
||||
{ "<leader>Du", "<cmd>DBUIToggle<cr>", desc = "Toggle UI" },
|
||||
{ "<leader>Df", "<cmd>DBUIFindBuffer<cr>", desc = "Find Buffer" },
|
||||
{ "<leader>Dr", "<cmd>DBUIRenameBuffer<cr>", desc = "Rename Buffer" },
|
||||
{ "<leader>Dq", "<cmd>DBUILastQueryInfo<cr>", desc = "Last Query Info" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>D"] = { name = " database" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "sqlls", "sqlfmt", "sqlfluff" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
sqlls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = function(_, opts)
|
||||
local function add_linters(tbl)
|
||||
for ft, linters in pairs(tbl) do
|
||||
if opts.linters_by_ft[ft] == nil then
|
||||
opts.linters_by_ft[ft] = linters
|
||||
else
|
||||
vim.list_extend(opts.linters_by_ft[ft], linters)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
add_linters({
|
||||
["sql"] = { "sqlfluff" },
|
||||
["plsql"] = { "sqlfluff" },
|
||||
["mysql"] = { "sqlfluff" },
|
||||
})
|
||||
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
opts = function(_, opts)
|
||||
local function add_formatters(tbl)
|
||||
for ft, formatters in pairs(tbl) do
|
||||
if opts.formatters_by_ft[ft] == nil then
|
||||
opts.formatters_by_ft[ft] = formatters
|
||||
else
|
||||
vim.list_extend(opts.formatters_by_ft[ft], formatters)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
add_formatters({
|
||||
["sql"] = { "sqlfmt" },
|
||||
["plsql"] = { "sqlfmt" },
|
||||
["mysql"] = { "sqlfmt" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"sqlite",
|
||||
"postgresql-16",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
{ import = "plugins.extras.lang.web.typescript-extended" },
|
||||
{ import = "plugins.extras.lang.web.html-css" },
|
||||
{ import = "lazyvim.plugins.extras.lang.angular" },
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"angular",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
return {
|
||||
{ import = "pugins.extras.lang.web.typescript-extended" },
|
||||
{ import = "plugins.extras.lang.web.html-css" },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "angular" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
angularls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "angular-language-server" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"angular",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Reference in a new issue