# Leveraging neovim as a TUI

+++ +++

I tend to be much faster using git from a TUI instead from using the commands in the terminal. Not exactly when doing add or commit but I, very much enjoy reviewing the code and checking the diff. I know I know... the good old git diff or diff-so-fancy are cool but I am a person of habits.

My biggest use case is that I normally want to break the work I've done into more than one commit and I'd like to see how everything is looking like meanwhile I work.

It just happened that there is a bug in gitui that happened to be a problem for me. I am using bitwarden as ssh-agent (not 100% happy with that yet) and I neet to manually specify which key to use for some sites. Then opportunity appeared.

Why not using the same git TUI for the shell and for Neovim?

I settled on Neogit since it looks like my good old beloved Magit. Then starting a new neogit session is as easy as:

alias g = nvim -c "lua require('neogit').open()" -c "autocmd TabClosed * if tabpagenr('$') == 1 | quit | endif"

The alias also sets a callback so that, if I press 'q' I go back to the shell automatically

This way I am using the same tool in when I am using the shell and when I am coding using neovim. Cool!