diff --git a/lua/plugins/prisma.lua b/lua/plugins/prisma.lua index 67dbb24..2f43df1 100644 --- a/lua/plugins/prisma.lua +++ b/lua/plugins/prisma.lua @@ -14,9 +14,40 @@ if pcode.active_prisma_config then opts.ensure_installed = opts.ensure_installed or {} vim.list_extend(opts.ensure_installed, { "prismals" }) vim.cmd([[ - autocmd BufWritePost *.prisma silent! execute "!npx prisma format" - ]]) + autocmd BufWritePost *.prisma silent! execute "!npx prisma format" + ]]) end, + keys = { + { "p", "", desc = "  Prisma" }, + { + "pf", + function() + vim.cmd("execute '!npx prisma format'") + end, + desc = "Prisma Format", + }, + { + "pm", + function() + vim.cmd("execute '!npx prisma init --datasource-provider mysql'") + end, + desc = "init MySQL", + }, + { + "pp", + function() + vim.cmd("execute '!npx prisma init --datasource-provider postgresql'") + end, + desc = "init postgresql", + }, + { + "pe", + function() + vim.cmd("execute '!npx prisma migrate dev --name init'") + end, + desc = "Migrate", + }, + }, }, } end