pojokcodeid.nvim-lazy/lua/plugins/prisma.lua

55 lines
1.4 KiB
Lua
Raw Normal View History

2024-06-30 18:02:32 +07:00
local M = {}
if pcode.active_prisma_config then
M = {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "prisma" })
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "prismals" })
vim.cmd([[
2024-06-30 18:53:42 +07:00
autocmd BufWritePost *.prisma silent! execute "!npx prisma format"
]])
2024-06-30 18:02:32 +07:00
end,
2024-06-30 18:53:42 +07:00
keys = {
{ "<leader>p", "", desc = "  Prisma" },
{
"<leader>pf",
function()
vim.cmd("execute '!npx prisma format'")
end,
desc = "Prisma Format",
},
{
"<leader>pm",
function()
vim.cmd("execute '!npx prisma init --datasource-provider mysql'")
end,
desc = "init MySQL",
},
{
"<leader>pp",
function()
vim.cmd("execute '!npx prisma init --datasource-provider postgresql'")
end,
desc = "init postgresql",
},
{
"<leader>pe",
function()
vim.cmd("execute '!npx prisma migrate dev --name init'")
end,
desc = "Migrate",
},
},
2024-06-30 18:02:32 +07:00
},
}
end
return M