The Holy Grail of Neovim Git Integrations

Поділитися
Вставка
  • Опубліковано 1 чер 2024
  • When it comes to Neovim and Git, there isn't one tool to rule them all, but with modern developments, I believe this setup comes close to perfection!
    Ways to support this channel:
    🎓 My course: learn.omerxx.com/courses/seco...
    📰 Become a better engineer in just 3 minutes a week: signup.omerxx.com
    ⌨️ Tech I use: kit.co/omerxx/my-battle-station
    LINKS
    ▶ Neogit: github.com/NeogitOrg/neogit
    ▶ Git signs: github.com/lewis6991/gitsigns...
    ▶ Fugitive: github.com/tpope/vim-fugitive
    ▶ LazyGit: github.com/jesseduffield/lazygit
    ▶ DiffView: github.com/sindrets/diffview....
    ⏱ Timestamps
    00:00 - Intro
    01:40 - LazyGit
    03:42 - Fugitive
    05:45 - Neogit
    08:53 - Diffview
    09:26 - Advanced Neogit
    11:16 - GitSigns
    #neovim #git #neogit #tmux #terminal #vim #dev #devops #linux #console
  • Наука та технологія

КОМЕНТАРІ • 90

  • @VitorF7
    @VitorF7 2 місяці тому +10

    I heavily use lazygit in my Neovim set-up, especially since in my team we use conventional commits and use a tool called czg that helps with writing the conventional commit messages. So in lazygit I added a key binding for capital Z to launch the czg for the commit message and it is super fast and really helpful.

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +3

      That’s super cool! I love it that you can customize it like that

    • @Redyf
      @Redyf Місяць тому +1

      I had no idea about czg, thanks for the tip!

  • @guglielmobartelloni
    @guglielmobartelloni 2 місяці тому +23

    With the Lazygit neovim plugin there is no context switch and you can do all the things mentioned.

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +5

      I should have included it here but while it is great(!) I still feel it’s a bit of a context switch and not as smooth

    • @CristianHeredia0
      @CristianHeredia0 2 місяці тому +8

      Agreed, switching/merging/creating/deleting branches is so seamless in Lazygit with plugin. That feature alone is worth the price of admission. Also viewing merging/squashing/amending commits so easy with lazygit.

    • @benfrainuk
      @benfrainuk 2 місяці тому +3

      Yes. 100%. And I might be odd but actually find/want a bit of context change. I find it helpful. I am context switching when I am dealing with VC and the float window gives me just enough separation.

    • @karesztrk
      @karesztrk 2 місяці тому

      I do agree as well

    • @po6577
      @po6577 25 днів тому

      Lazygit are truly the best without much or not even a learning curve

  • @nickmills8476
    @nickmills8476 2 місяці тому +10

    big fugitive fan, but neogit is beckoning

  • @fib4983
    @fib4983 2 місяці тому +2

    Thank you for compiling lots of up to date options. Very interesting

  • @ascourter
    @ascourter 2 місяці тому +3

    Ok I'm installing Neogit today. Thanks for the video Omer!

  • @misterlinuxfriendly947
    @misterlinuxfriendly947 2 місяці тому +1

    I find I'm getting by with gitsigns, for now, but its nice to see alternatives! Thanks!

  • @theherk
    @theherk 2 місяці тому +1

    I absolutely love neogit. Used magit for years. But i still use lazygit about 50/50. Partly because it is editor independent and partly because its commit copy paste, rebasing, and moving are super slick. But in general I like neogit the most.

  • @driden1987
    @driden1987 2 місяці тому +6

    Been using lazygit for a couple of years now, but ngl neogit looks so good. Reminds me a bit of magit

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +2

      It was inspired by Magit :)

    • @driden1987
      @driden1987 2 місяці тому

      @@devopstoolboxThanks for sharing these plugins!!

  • @lpanebr
    @lpanebr 2 місяці тому +1

    Cool! I'll give NeoGit a try! Thanks!

  • @celsopatiri2846
    @celsopatiri2846 2 місяці тому +1

    Awesome video, thank you for this

  • @sarojregmi200
    @sarojregmi200 2 місяці тому

    Perfect timing of the video, just went through a small git merge managed to successfully break the code with git and had to revert reset hard. Vim fusitive is hard at least for me for merging.

  • @mellamovicente
    @mellamovicente 2 місяці тому

    Hey, nice video! really inspired me to stop using cli for every git command and it's been amazing :)
    At first I couldn't make 'neogit commit' work out-of-the-box. I thought that since I'm using Nvchad, somehow that configuration was messing up with neogit.
    After spending a lot of time (maybe there are better/simplier solutions) I change the following:
    1. Add an autocmd that start a nvim server in my init.lua with 'vim.api.startserver('path')'.
    2. Edit the client.lua file from the neogit config directory in the line 53. I manually added a path to 'fn.startserver('path)'.
    In both cases I had to specify the server path (in my case /tmp/nvim.socket and /tmp/neogit.socket). Again, idk why the default parameters of vim.api.startserver() didn't work.

  • @adibhanna
    @adibhanna 2 місяці тому +1

    great video as usual!

  • @peterhorton9063
    @peterhorton9063 2 місяці тому +2

    Awesome. I'm curious how you did the pull-request flow on push. Can you elaborate more on that process?

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      You mean the PR link? When pushing with fugitive it shows the response from the platform , so when GitHub sends back a url with a PR I use Tmux URL plugin to fetch whatever it finds on screen and then hit it to pop the PR page

  • @JoshMedeski
    @JoshMedeski 2 місяці тому +1

    I love Magit in Emacs and had been hoping someone would create a decent alternative for Neovim. I think Neogit offers a great alternative!

  • @markussagen3778
    @markussagen3778 2 місяці тому +9

    So nvim finally has magit

  • @Nicfallenangel
    @Nicfallenangel 2 місяці тому +1

    I love NeoGit, however the last time I used it, there were a few optios that weren't implimented in the plugin still. That ultimately pushed me back to lazygit in a tmux pop-up to handle my git workflow. It might be time to give neogit another run through.

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      Yep! And apparently there’s now a lazygit nvim plugin with seamless integration

  • @tridibbiswas3361
    @tridibbiswas3361 2 місяці тому

    Thank you for the video. A newbie question who is trying to set up neovim from scratch onmy first mac - would you mind sharing the config files for your setup neovim and tmux - would like to refer to it and take inspiration. BTW would also like to know how to get the fancy icons on your tmux , color scheme and fonts

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      Of course!
      dotfiles.omerxx.com
      It’s all there

  • @be_pie_today
    @be_pie_today 2 місяці тому +2

    I prefer using plain git commands for most tasks, except for browsing history and maybe blame. All those tools just seem counter productive when I use them

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +1

      Yep, we’re not all the same! I figured most of my git ops are the quickest when using something lean from within Neovim

  • @LeviNotik
    @LeviNotik 2 місяці тому +1

    What plug-in or config is he using to open that floating "Cmdline" input where he types "DiffViewOpen" at 8:56?

    • @LeviNotik
      @LeviNotik 2 місяці тому +1

      Oh looks like that's noice? Noiceeee

  • @HRB35
    @HRB35 2 місяці тому +1

    can you teach me how you opened that url picker at 4:43? is that a telescope extension?

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      Of course: github.com/wfxr/tmux-fzf-url
      All in my config: github.com/omerxx/dotfiles/blob/master/tmux/tmux.conf

  • @danieljeremia1410
    @danieljeremia1410 2 місяці тому +1

    That status bar looks amazing. Can you share your config for that status bar?

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      Everything is in my dotfiles! dotfiles.omerxx.com
      You’ll find both the lua line config and Tmux!

  • @johnsci911
    @johnsci911 2 місяці тому +1

    Switched to neogit, thanks it's awesome. but can anyone have an idea (plugin) to create a branch without typing in `git checkout -b branchname`?

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      On most of my projects I use git trees on a bare repo, and then use the primeagens plugin to create and manage them, I’ve got a video about it too

  • @editin232
    @editin232 2 місяці тому

    Can you make a tutorial on how to use dandavison/delta for nicer view of diffs in lazyGit?
    I think that is a good thing people from VS Code (like myself) would are used to and would really like in lazyGit.

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      Diff view should take care of that for you! Super easy to use!

  • @frankslsh
    @frankslsh 2 місяці тому +1

    Maybe a little off topic but I often find very difficult to beat gitk for branch integrations. As a sort of team leader I often need to validate before integrating many branches into master by performing code reviews, view diffs, etc. I wonder which tools big code integrators like Linus use to perform these tasks. I'll give lazygit a try because it has the 'a' flag which is equivalent to "gitk --all" that is probably the command I use the most

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      Maybe gh dash can help with lots of branches diffs and PR management -
      gh-dash on GitHub

    • @frankslsh
      @frankslsh 2 місяці тому

      @@devopstoolbox Thanks for the tip, unfortunately we do not use github for repo storage, I generally do this integrations locally on my pc

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      @@frankslsh I see. My favorite way is actually running a worktree structure and then opening multiple buffers / splits with different trees for comparison. Diffview serves as the actual diff visualizer

  • @Ibrahimdevelopment
    @Ibrahimdevelopment 2 місяці тому +1

    I use fugitive instead of lazygit because of less visuals, it's a really really good plugin!

  • @DanielRicardo-qb6ho
    @DanielRicardo-qb6ho Місяць тому +1

    I have a dream of a diffview for PRs that would also allow me to write comments and send them straight to GitHub / GitLab - this is the final missing link for my Neovim / Git integration.

    • @devopstoolbox
      @devopstoolbox  Місяць тому

      Maybe this is what you're looking for?
      github.com/dlvhdr/gh-dash

    • @tspindouble
      @tspindouble Місяць тому

      For GitHub you can do this with gh.nvim or octo.nvim

    • @tspindouble
      @tspindouble Місяць тому

      I also recently came across danobi/prr on GitHub which is a different take on the problem: it's based around writing comments into a diff file and then running a CLI to submit them as a PR review - so it's editor-agnostic

  • @caoticus
    @caoticus 4 дні тому +1

    What is that cmdline pop up thing ?

    • @devopstoolbox
      @devopstoolbox  4 дні тому

      I'm assuming you're referring to Noice.nvim

  • @luiscampos6064
    @luiscampos6064 2 місяці тому

    Silly canonical question: Does TUI refer to "Text User Interface" or "Terminal User Interface"? Taking notes here and...it's a reasonable doubt, okay? Great content. Bye bye!

  • @WalterBoring
    @WalterBoring 8 днів тому

    How do you get the popup to enter the neogit command? You went too quickly in the video and didn't explain how that worked?

    • @devopstoolbox
      @devopstoolbox  8 днів тому

      Sorry, not sure which part but, leader+gs starts Neogit with the status panel while leader leader+gc pops the commit menu. Everything is on my dotfiles if you want it: dotfiles.omerxx.com

  • @editin232
    @editin232 2 місяці тому +1

    In my opinion lazyGit is not any more context switching that any of the options showcased in the video.

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +1

      We’re not all wired the same 😎

  • @NormalNvim
    @NormalNvim 2 місяці тому

    All of them included in NormalNvim!

  • @gmcusaro
    @gmcusaro 2 місяці тому +1

    3:58 (off topic - maybe for a next video) - Which nvim plugin do you use to show links in markdown without [name](url) and the icon on the right?

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +1

      I'm using Obsidian for notes and it's nvim plugin is configured to load on all markdown files. It has a nice concealer taking care of links, lists, etc.
      I made a video about it - ua-cam.com/video/5ht8NYkU9wQ/v-deo.htmlsi=L6iBbzyNJ_u0Vt7L
      This is the plugin: github.com/epwalsh/obsidian.nvim

    • @gmcusaro
      @gmcusaro 2 місяці тому

      Thanks! Great videos!

  • @JasonJurotich
    @JasonJurotich 2 місяці тому

    Sorry, could you share your neovim config, would be nice to review it and see how to configure things better. thanks

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      Of course!
      dotfiles.omerxx.com
      It’s all there

    • @JasonJurotich
      @JasonJurotich 2 місяці тому

      thanks!! was able to take a few things from it. Keep it up!@@devopstoolbox

  • @Redyf
    @Redyf 29 днів тому

    Does neogit feels laggy on large repos?

    • @devopstoolbox
      @devopstoolbox  29 днів тому +1

      I am working with large repos (Kubernetes) but not actually making commits, I did use it for branches and other local use and didn't see anything out of the order

    • @Redyf
      @Redyf 28 днів тому +1

      @@devopstoolbox Thanks! I've tried neogit in the past but eventually switched to lazygit (which is really good too) but I might give neogit a another chance to see how it feels.

  • @rickdg
    @rickdg 2 місяці тому +1

    Title has a typo on integrations 👀

    • @devopstoolbox
      @devopstoolbox  2 місяці тому +2

      Thank you!! It never ceases to amaze me how many thousands can watch it without noticing (or bothering to comment 😂)
      🙏🏽

  • @MrLotrus
    @MrLotrus 2 місяці тому +1

    Maybe with git blame i could move to neogit. For now fugitive is ok.

  • @r2-p2
    @r2-p2 2 місяці тому

    Onye neogit fixes those show stopping bugs it might be something but for now, each time a conflict appears, the status view is broken. Wtf

    • @devopstoolbox
      @devopstoolbox  2 місяці тому

      Interesting I didn’t see that, will try lay with conflicts again

  • @freeFHH
    @freeFHH Місяць тому +1

    neogit is very similar to magit

  • @karesztrk
    @karesztrk 2 місяці тому

    Maybe its just me but anything else other than Lazygit is friction 😅b

  • @RazoBeckett.
    @RazoBeckett. 2 місяці тому

    hi

  • @r2com641
    @r2com641 Місяць тому

    Neogit is buggy and freezes often for no reason

    • @devopstoolbox
      @devopstoolbox  Місяць тому

      Hmmm.. I've been using it fulltime for a good few months and never had it freezing up on me. Maybe a buggy version?

  • @laughingvampire7555
    @laughingvampire7555 2 місяці тому +1

    Removing distractions and keep focus is why Emacs users do everything in Emacs.