Vim Fugitive in Action (2021)

11 todsacerdoti 5 7/9/2025, 10:36:26 PM dzx.fr ↗

Comments (5)

skydhash · 13h ago
Fugitive is the lite version of Magit. Useful for all the common actions that you may need to do, especially with regards to the current file. Also no context switching like you'd do with tmux and other tools. But the nice thing about Magit is Transient (which is itself a nice pattern CLI tools). Full interactivity over the myriad of flags and parameters git have.
dasil003 · 13h ago
This article glosses over what I consider to be the killer workflow of Fugitive. Specifically the ability to trace history extremely efficiently across any kind of refactoring.

The flow is: 1. :G blame to blame the current file in a locked split 2. navigate to a line, then hit o to open the commit in another split 3. search for a change of interest, then navigate to either the --- or +++ line and hit o to open the before or after version of the file in another split 4. repeat steps 1-3 as needed to drill to whatever history you need 5. ctrl-w o to kill all the splits and leave you with just the buffer of interest

whereas I'm pretty happy with git CLI for the majority of git interaction, and a graphical client like gitk for visualizing branch history, I haven't found any other history inspection technique or tool that comes close to this.

wonger_ · 14h ago
This was helpful. I've had "try vim fugitive" on my todo list for a while. But it seems to have way too many bespoke keybinds and interactions for my liking. Anybody have other recommendations for vim git integrations? Should I use something like lazygit instead?
cjhveal · 13h ago
Personally, I just break out to the CLI for the vast majority of use cases. Things like viewing logs or making commits or staging hunks with `git add --patch`. I'd suggest looking at only replacing the parts of your workflow that are painful and keep what works. For example, I've heard many folks say that fugitive's `:Git blame` support is the killer feature for them.

To that end, I'd probably pick up a good Terminal User Interface like `lazygit` before spending much time investing into fully driving git through vim. Grains of salt suggested, but if you're interested in exploring other git TUI options, I've also heard good things about `gitui`[0].

[0]: https://github.com/gitui-org/gitui

eulgro · 10h ago
lazygit is the best thing ever. You can use vim keybindings and there's a vim plugin too.