Explore the Rise of Terminal Applications: A Deep Dive into Modern CLI Tools
As developers increasingly embrace terminal applications for their efficiency and simplicity, a wave of innovative tools is emerging. From Git management to resource monitoring, these applications are...
Didn't think that I'll be impressed by a terminal app since I'm not the hardcore keyboard coder. But #lazygit (and #lazydocker) are impressive tools, especially for quick rebases in my own branch, amending, squashing and splitting commits via patch. 1/
@adamchainz you could also try out #lazygit
Pretty big release of #lazygit:
Release v0.45.0 · jesseduffield/lazygit · GitHub
https://github.com/jesseduffield/lazygit/releases/tag/v0.45.0
A new version of lazyvim-confirm. (Should I turn this into a proper #NeoVim plugin?)
vim.keymap.set("n", "<leader>gg", function()
local unsaved_table = {}
local choice = 1
for _, buf_id in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_get_option_value("modified", { buf = buf_id }) then
table.insert(unsaved_table, string.format("%3d", buf_id) .. ": " .. vim.api.nvim_buf_get_name(buf_id))
end
end
if #unsaved_table ~= 0 then
choice = vim.fn.confirm(
"There are unsaved buffers:\n\n" .. table.concat(unsaved_table, "\n") .. "\n\nDo you still want to run lazygit?",
"&Yes\n&No\nShow &Buffers",
2
)
end
if choice == 1 then
Snacks.lazygit()
elseif choice == 3 then
vim.cmd([[FzfLua buffers sort_mru=true sort_lastused=true]])
end
end, { noremap = true })
EDIT: Hacked together solution in next post.
#NeoVim HIVEMIND: #LazyVim has the nice shortcut <leader>gg
, which launches #lazygit in a window. However, I would like NeoVim to warn me if any buffers are unsaved before launching lazygit.
I forget far too often and end up committing most of my changes but not all of them, because I've forgotten to save my buffer.
Does anyone have any idea what I should be looking for? I guess I need (with very bad pseudocode):
if unsaved_buffers then
confirm = dialog("There are unsaved buffers. Do you still want to launch lazygit?")
if !confirm then
return
endif
endif
launch_in_window(lazygit) // or send <leader>gg
If #lazygit didn't exist I would switch my workflow to using #jj /#jujutsu, it is realllly nice. Spent a week using it and was incredibly satisfied with how it all worked once I got my head out of git mode. People who use the cli to use #git I strongly encourage you to check it out. (My brain is just too hard-wired to the lazygit keybinds)
#zed is really growing on me.
Each new update enhances the user experience, making it more enjoyable. However, it still needs a robust git management feature (it's coming...).
Meanwhile, I use #lazygit within the integrated terminal, which I open and enlarge when needed.
https://zed.dev
The git history of my nix config repository turned out to be really useful because I „documented“ one of the issues in a commit message: https://github.com/britter/nix-configuration/commit/bd0a7c45da51a2e5011bc26ef0e3bd5d1d33720f
Using the lazygit history search it was super easy to find this and remind myself of the issue.
#NixOS #git #lazygit