Lazygit in Neovim
There seems to be a bit of a buzz going around at the moment about Lazygit. Well, at least in very niche (and very cool) Neovim circles. It’s just a matter of time before it reaches the wider audience of the general public and the whole thing blows up in spectacular Justin Beiber style. Obviously.
As a hip early-adopter I thought I would try it out and see if the product delivers on the hype. TLDR — it does. Therefore in this blog article I want to introduce Lazygit. What it is, why you should use it and how to use it in Neovim (the Mother of all Text Editors).
What is Lazygit
Lazygit is a “simple terminal UI for git commands” and is developed by an Australian by the name of Jesse Duffield. The end of the elevator pitch on their github page sums it up for me…
If you’re a mere mortal like me and you’re tired of hearing how powerful git is when in your daily life it’s a powerful pain in your ass, lazygit might be for you.
Definitely worth trying out.
The Simple UI
The creators of this tool are not wrong when describing the UI as simple. It is simply laid out but don’t mistake that for being a simple tool. It possesses a wealth of functionality but at the same time it brings you much needed clarity when working in a codebase using git.

It’s all laid out in a logical manner. You can navigate around the different panels using Vim keybindings: H, J, K, L. Pressing space
will usually select something and enter
to go into something (like viewing the files changed in a specific commit).
With this UI you can clearly see:
- Your current branch and other branches you have locally
- What specific unstaged changes you have done in the current commit
- A list of latest commits on the checked out branch
- The command log where you see the actual git commands being used as you work within Lazygit
- Pressing
?
brings up a helpful help modal so it’s very easy to get to know the controls - It allows you to easily commit individual files
- Allows for easy stashing of files
Honestly, it took me a few minutes to get familiar with the UI and a couple of days to get used to how to use the main features. It was a very smooth transition from the tool I was using previously for git commands.
Why did I switch to Lazygit?
I was using VScode’s git tool before and honestly it was absolutely fine. However, I switched editors over to Neovim because I wanted to be more efficient. Apparently using keyboard only, instead of keyboard and mouse combination, leads to quicker and more efficient work. So I made the switch which could ultimately allow me to adopt this new habit. (Whether or not this is true is up to debate but I went down this rabbit hole anyway).
It does require you to remember quite a few commands and when it comes to the less used stuff like rebasing or reverting I often found myself looking up the commands again to remember exactly how to do them.
Using Neovim forced me to reassess the git tool I was going to use. There are some great GUI tools out there like Fork, GitLens, GitKraken etc… but I didn’t want a separate tool. I wanted something that integrated with Neovim or at least seemed seamlessly integrated.
I could have used the command line and worked with all the git commands and for a while I did. Honestly, it gives you everything you need, but it does require you to remember quite a few commands and when it comes to the less used stuff like rebasing or reverting I often found myself looking up the commands again to remember exactly how to do them.
Then I stumbled across Lazygit on Youtube and thought I would try it out. It was open-source, it could be integrated into Neovim and it had a pretty shallow learning curve. I was sold!
Integrating into Neovim
To integrate Lazygit into Neovim is pretty straightforward using this plugin. I am using Lazy.nvim as my plugin manager. I created a lazygit.lua
file in my plugins
folder and used this code:
return {
"kdheepak/lazygit.nvim",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "Open lazy git" },
},
}
Restarted Neovim and it just worked. You can see I setup a keymap of <leader>lg
to open Lazygit. Pressing q
closes the window. So now when working I just use the keymap and bam! I get all the git info I want and can commit, stage, push and pull easily. All of this without ever touching my mouse. Pretty neat.
Conclusion
Git is an integral part of any developer’s workflow these days so choosing the right tool to work with git is important. We are spoilt for choice in the Software world and each tool out there brings it’s own flavour and benefits. However, if you like working in the terminal window like me then Lazygit is well worth a try. I can’t see me switching from this tool anytime soon. Another instance of the Open Source world providing great benefits.
Subscribe
If you liked this blog post you can subscribe to receive emails every time I publish. I publish every Monday morning at 8:30 Central European Time.
About me
I am a Frontend Developer working mainly with React and Typescript in my day-to-day professional life. I love exploring new tools and libraries and love the Javascript Ecosystem.
I like to write blog posts that share exciting new tools I’ve discovered, how-to articles, and also the occasional opinion piece.
I live in Prague in the Czech Republic with my family.
Check out the original blog post on my blog.
Check out my LinkedIn and Github if you are interested.
In Plain English 🚀
Thank you for being a part of the In Plain English community! Before you go:
- Be sure to clap and follow the writer ️👏️️
- Follow us: X | LinkedIn | YouTube | Discord | Newsletter
- Visit our other platforms: Stackademic | CoFeed | Venture | Cubed
- Tired of blogging platforms that force you to deal with algorithmic content? Try Differ
- More content at PlainEnglish.io