mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-23 17:28:50 +02:00
enc: update modal npm runner
This commit is contained in:
parent
23a8cf07bf
commit
7450625ba8
6 changed files with 588 additions and 161 deletions
|
@ -1,40 +1,43 @@
|
|||
return {
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"stevearc/conform.nvim",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
opts.formatters = opts.formatters or {}
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
-- vim.list_extend(opts.ensure_installed, { "stylua" })
|
||||
opts.lang_maps = opts.lang_maps or {}
|
||||
opts.name_maps = opts.name_maps or {}
|
||||
opts.add_new = opts.add_new or {}
|
||||
opts.ignore = opts.ignore or {}
|
||||
opts.format_on_save = opts.format_on_save or true
|
||||
opts.format_timeout_ms = opts.format_timeout_ms or 5000
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("auto-conform").setup(opts)
|
||||
-- other conform config
|
||||
local conform = require("conform")
|
||||
if opts.format_on_save then
|
||||
conform.setup({
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
timeout_ms = opts.format_timeout_ms or 5000,
|
||||
},
|
||||
})
|
||||
end
|
||||
vim.keymap.set({ "n", "v" }, "<leader>lF", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = opts.format_timeout_ms or 5000,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"stevearc/conform.nvim",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
opts.formatters = opts.formatters or {}
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
-- vim.list_extend(opts.ensure_installed, { "stylua" })
|
||||
opts.lang_maps = opts.lang_maps or {}
|
||||
opts.name_maps = opts.name_maps or {}
|
||||
opts.add_new = opts.add_new or {}
|
||||
opts.ignore = opts.ignore or {}
|
||||
opts.format_on_save = opts.format_on_save or true
|
||||
opts.format_timeout_ms = opts.format_timeout_ms or 5000
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("auto-conform").setup(opts)
|
||||
-- other conform config
|
||||
local conform = require("conform")
|
||||
if opts.format_on_save then
|
||||
conform.setup({
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
timeout_ms = opts.format_timeout_ms or 5000,
|
||||
},
|
||||
})
|
||||
end
|
||||
vim.keymap.set({ "n", "v" }, "<leader>lF", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = opts.format_timeout_ms or 5000,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>l", "", desc = " Lsp" },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -94,10 +94,29 @@ local M = {
|
|||
end
|
||||
|
||||
require("neotest").setup(opts)
|
||||
require("pcode.user.npmrun").setup("npm run dev")
|
||||
local command = pcode.npm_commad
|
||||
or {
|
||||
dev = {
|
||||
start = "NpmRunDev",
|
||||
stop = "NpmStopDev",
|
||||
cmd = "npm run dev",
|
||||
},
|
||||
prod = {
|
||||
start = "NpmStart",
|
||||
stop = "NpmStop",
|
||||
cmd = "npm start",
|
||||
},
|
||||
}
|
||||
require("pcode.user.npmrun").setup(command, {
|
||||
show_mapping = "<leader>nm",
|
||||
hide_mapping = "<leader>nh",
|
||||
width = 70,
|
||||
height = 20,
|
||||
})
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{"<leader>n","",desc=" Npm"},
|
||||
{ "<leader>T","",desc=" Test"},
|
||||
{ "<leader>Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
|
||||
{ "<leader>Tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
|
||||
|
|
|
@ -3,6 +3,7 @@ return {
|
|||
lazy = true,
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<leader>u", "", desc = " Notify" },
|
||||
{
|
||||
"<leader>uN",
|
||||
function()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue