Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7c6096095 | ||
|
|
2c429163b8 | ||
|
|
241c2074d3 |
+6
-8
@@ -2,21 +2,22 @@ local M = {}
|
|||||||
|
|
||||||
local function run_task(cmd)
|
local function run_task(cmd)
|
||||||
vim.notify(" Running: " .. cmd)
|
vim.notify(" Running: " .. cmd)
|
||||||
vim.cmd("enew")
|
|
||||||
|
|
||||||
local buf = vim.api.nvim_get_current_buf()
|
local buf = vim.api.nvim_create_buf(true, true)
|
||||||
pcall(vim.api.nvim_buf_set_name, buf, "just://" .. cmd)
|
pcall(vim.api.nvim_buf_set_name, buf, "just://" .. cmd)
|
||||||
|
|
||||||
|
vim.api.nvim_buf_call(buf, function()
|
||||||
vim.fn.termopen(cmd, {
|
vim.fn.termopen(cmd, {
|
||||||
on_exit = function(_, code)
|
on_exit = function(_, code)
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
vim.notify(" " .. cmd .. " success")
|
vim.notify(" " .. cmd .. " success")
|
||||||
pcall(vim.cmd, "bdelete!")
|
pcall(vim.api.nvim_buf_delete, buf, { force = true })
|
||||||
else
|
else
|
||||||
vim.notify(" " .. cmd .. " failed (" .. code .. ")", vim.log.levels.ERROR)
|
vim.notify(" " .. cmd .. " failed (" .. code .. ")", vim.log.levels.ERROR)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Interactive picker for selecting and running tasks defined in a Justfile.
|
--- Interactive picker for selecting and running tasks defined in a Justfile.
|
||||||
@@ -26,14 +27,11 @@ function M.pick_just_task()
|
|||||||
return vim.notify("No recipes or justfile found", vim.log.levels.WARN)
|
return vim.notify("No recipes or justfile found", vim.log.levels.WARN)
|
||||||
end
|
end
|
||||||
|
|
||||||
local recipes = vim.split(vim.trim(obj.stdout), "%s+")
|
|
||||||
require("mini.pick").start({
|
require("mini.pick").start({
|
||||||
source = {
|
source = {
|
||||||
items = recipes,
|
items = vim.split(vim.trim(obj.stdout), "%s+"),
|
||||||
name = " Just Tasks",
|
name = " Just Tasks",
|
||||||
choose = function(choice)
|
choose = function(choice) run_task("just " .. choice) end,
|
||||||
run_task("just " .. choice)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
-- Colortheme ==================================================================
|
-- Colortheme ==================================================================
|
||||||
Config.now(function()
|
Config.now(function()
|
||||||
vim.pack.add({ "https://github.com/rose-pine/neovim" })
|
vim.pack.add({ { src = "https://github.com/rose-pine/neovim", name = "rose-pine" } })
|
||||||
require("rose-pine").setup({
|
require("rose-pine").setup({
|
||||||
enable = {
|
enable = {
|
||||||
|
terminal = false,
|
||||||
legacy_highlights = false,
|
legacy_highlights = false,
|
||||||
migrations = false,
|
migrations = false,
|
||||||
},
|
},
|
||||||
@@ -28,7 +29,7 @@ Config.now_if_args(function()
|
|||||||
Config.autocmd('FileType', filetypes, function(ev)
|
Config.autocmd('FileType', filetypes, function(ev)
|
||||||
if pcall(vim.treesitter.start, ev.buf) then
|
if pcall(vim.treesitter.start, ev.buf) then
|
||||||
if vim.bo[ev.buf].filetype == 'php' then
|
if vim.bo[ev.buf].filetype == 'php' then
|
||||||
-- fixes broken indentation on `o` in php buffers
|
-- Fixes broken indentation on `o` in php buffers
|
||||||
vim.bo[ev.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
vim.bo[ev.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -75,6 +76,11 @@ Config.now_if_args(function()
|
|||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
go = { "gofumpt", "goimports" },
|
go = { "gofumpt", "goimports" },
|
||||||
php = { "php_cs_fixer" },
|
php = { "php_cs_fixer" },
|
||||||
|
json = { "jq" },
|
||||||
|
javascript = { "biome" },
|
||||||
|
typescript = { "biome" },
|
||||||
|
javascriptreact = { "biome" },
|
||||||
|
typescriptreact = { "biome" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user