Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit git commit and git rebase -i inside neovim #29

Open
figsoda opened this issue Aug 1, 2021 · 8 comments
Open

Edit git commit and git rebase -i inside neovim #29

figsoda opened this issue Aug 1, 2021 · 8 comments
Labels
help wanted Extra attention is needed idea

Comments

@figsoda
Copy link

figsoda commented Aug 1, 2021

What?
Something similar to :Git commit and :Git rebase -i commands in vim-fugitive

Why?
All the neovim plugins I found are git interfaces that does a lot of things like neogit and lazygit.nvim. I just want to git commit inside neovim and not see double status bars.

Potential existing implementations:
vim-fugitive

Potential pitfalls:
I don't know how it works and vim-fugitive is not a small code base to read.

@figsoda figsoda added help wanted Extra attention is needed idea labels Aug 1, 2021
@francisco285
Copy link

It's not a lua plugin, but I think it's worth mentioning that if you use vim-floaterm, those commands will open a buffer in your current neovim instance, it works very well for me.

@matu3ba
Copy link

matu3ba commented Aug 26, 2021

  1. Personally I had problems with using git inside the in-build terminal for inserting text on commits. And without terminal support the solution will not be flexible enough as indicated by vim-fugitive. Fixing git inside terminal inside neovim would be needed.

  2. Personally I think a spawned git shell with common useful abbreviations gp,gpush,gb,gba,grbium,grbiuM being usable as shell import would have a much bigger impact (being usable outside neovim and is less effort to write). I did not do that yet due to point 1., but it should be <100 LOC or directly configurable inside shell solutions (be it floating window, harpoon, termux integration etc).
    See my aliases_git file for ideas what aliases to load for the shell.

  3. For interactive rebase there is git interactive rebase tool. Its very minimalistic and the only real downsides are missing indexes for direct jumps and multi-steps, so too big or frequent rebasing might get annoying. For some reasons Rust tools are not sufficiently active to update their git bindings.

  4. However, if one uses big or frequent rebases one should learn the git features for dealing with that.

@matu3ba
Copy link

matu3ba commented Jul 7, 2022

I think replacinig rebase -i in all use cases will be tricky, because fugitive combines diffview.nvim with efficient merge conflict resolving and there is no lua plugin to resolve merge conflicts yet.

If you only have a few simple use cases, then you would need to fallback to the shell anyway. So it doesnt have a big value, if you cant do it in the shell then.

@matu3ba
Copy link

matu3ba commented Jul 15, 2022

BTW: You can now also use git commit and git rebase -i inside the inbuild shell (for example with vim) and it doesnt have cluttered symbols.

I use this every day in harpoon.

@matu3ba
Copy link

matu3ba commented Sep 16, 2022

diffview.nvim has now https://github.com/sindrets/diffview.nvim#merge-tool, which offers 3-way, 4-way and and single window merge layout:

In addition to the normal :h copy-diffs mappings, there are default mappings provided for jumping between conflict markers, obtaining a hunk directly from any of the diff buffers, and accepting any one, all, or none of the versions of a file given by a conflict region.

I think having additionally gitsigns for quick file-local actions and visualizations of markers makes it a very complete solution that is nothing short of fugitive.

Except more configuration to get short command lengths (fugitive defaults to :Git subcommand for any command action`.

Please let me know, if this can be closed or what you think is missing.

@figsoda
Copy link
Author

figsoda commented Sep 16, 2022

You can now also use git commit and git rebase -i inside the inbuild shell (for example with vim) and it doesnt have cluttered symbols.

is this with diffview? because i used the built in term:// and it gives me double status line, double buffer line, and all the hotkeys are kinda wonky

@figsoda
Copy link
Author

figsoda commented Sep 16, 2022

what I'm missing is editing the git commit files in a native buffer instead of inside another instance of nvim in the terminal

@willothy
Copy link

what I'm missing is editing the git commit files in a native buffer instead of inside another instance of nvim in the terminal

flatten.nvim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed idea
Projects
None yet
Development

No branches or pull requests

4 participants