mirror of
https://github.com/hydroxycarbamide/dotfiles.git
synced 2025-07-07 05:19:26 -04:00
Add yazi plugins
This commit is contained in:
parent
87fb0d61e5
commit
0e06731987
13 changed files with 520 additions and 2 deletions
31
dot_config/yazi/plugins/lazygit.yazi/readonly_main.lua
Normal file
31
dot_config/yazi/plugins/lazygit.yazi/readonly_main.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
return {
|
||||
entry = function()
|
||||
local output = Command("git"):arg("status"):stderr(Command.PIPED):output()
|
||||
if output.stderr ~= "" then
|
||||
ya.notify({
|
||||
title = "lazygit",
|
||||
content = "Not in a git directory",
|
||||
level = "warn",
|
||||
timeout = 5,
|
||||
})
|
||||
else
|
||||
permit = ya.hide()
|
||||
local output, err_code = Command("lazygit"):stderr(Command.PIPED):output()
|
||||
if err_code ~= nil then
|
||||
ya.notify({
|
||||
title = "Failed to run lazygit command",
|
||||
content = "Status: " .. err_code,
|
||||
level = "error",
|
||||
timeout = 5,
|
||||
})
|
||||
elseif not output.status.success then
|
||||
ya.notify({
|
||||
title = "lazygit in" .. cwd .. "failed, exit code " .. output.status.code,
|
||||
content = output.stderr,
|
||||
level = "error",
|
||||
timeout = 5,
|
||||
})
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue