mini.nvim icon indicating copy to clipboard operation
mini.nvim copied to clipboard

mini.git alternative to vim-fugitive

Open adastx opened this issue 2 years ago • 13 comments

Contributing guidelines

Module(s)

None

Description

I think another valuable addition would be port of tpope/vim-fugitive to neovim.

adastx avatar Oct 09 '22 18:10 adastx

Thanks for the suggestion!

Thought about this did cross my mind. It is a monumental task and there are great alternatives. Personally I use lazygit in terminal and that is more than enough.

So it is a "maybe", but not in the near future.

echasnovski avatar Oct 09 '22 18:10 echasnovski

Always looked for this but never found it, if it ever makes it to Mini that would be incredible!

unansweredocd avatar Oct 21 '22 18:10 unansweredocd

I also look forward to a sensible and great lua alternative to fugitive, but in my opinion git integration would have really a lot of and extensive features to write. Wouldn't it be too big for the scope of minimal "mini.vim"?

wookayin avatar Oct 30 '22 04:10 wookayin

I also look forward to a sensible and great lua alternative to fugitive, but in my opinion git integration would have really a lot of and extensive features to write. Wouldn't it be too big for the scope of minimal "mini.vim"?

That is my current state of mind on this topic, yes. But you never know, maybe some manageable approach will come to mind here.

A year ago I had the same opinion about Lua replacement of 'targets.vim', an yet 'mini.ai' came just at the limit of what I consider a comfortable module size and scope.

echasnovski avatar Oct 30 '22 04:10 echasnovski

I'm sure requirements are different for everyone but git commit, pull, push and log would be a great starting point.

unansweredocd avatar Oct 31 '22 08:10 unansweredocd

git grep to quickfix list is basically my only requirement, personally.

adastx avatar Oct 31 '22 10:10 adastx

I'm sure requirements are different for everyone but git commit, pull, push and log would be a great starting point.

Yep, for me too. Plus partial staging. These are mostly everything I've done with 'vim-fugitive' back when I was using it.

echasnovski avatar Oct 31 '22 15:10 echasnovski

Honest question, what would be the advantage of porting vim-fugitive instead of using it as is?

diogob avatar Sep 13 '23 18:09 diogob

Honest question, what would be the advantage of porting vim-fugitive instead of using it as is?

No one says about porting the whole 'tpope/vim-fugitive'. And no one says the result will have an advantage.

The whole idea of 'mini.nivm' is to provide all round out of the box experience with relatively comprehensible code base (with strictly one file per full "plugin"). As I consider Git to be an essential part of modern advanced text editor experience, hence 'mini.git' is something I am not against of doing eventually.

echasnovski avatar Sep 13 '23 18:09 echasnovski

@echasnovski thanks for the reply and for all your work on mini.nvim :heart: (and for your nvim setup which I have shamelessly lifted)

diogob avatar Sep 13 '23 19:09 diogob

git grep to quickfix list is basically my only requirement, personally.

@adastx I have been happy with this so :grep uses git grep:

vim.o.grepprg = 'git --no-pager grep --no-color -n $*'
vim.o.grepformat = '%f:%l:%m,%m %f match%ts,%f'

bzub avatar Feb 24 '24 17:02 bzub

One thing I love about fugitive is :Git: it allows me to leverage all my CLI git-fu (and vice versa, reinforces it) with -- where meaningful -- Vim integration and the convenience of not having to spam a terminal for one-off commands.

A mini.git that offers (only) this interface would be very appealing to me. (You could still create custom mappings for often-used commands, of course.) Benefit would be lower-latency vim.system implementation (fugitive can be quite slow if it has to process a lot of content into a buffer).

(Of course, my pipe dream is https://github.com/libgit2/luagit2 integration in Neovim...)

clason avatar Feb 25 '24 12:02 clason

One thing I love about fugitive is :Git: it allows me to leverage all my CLI git-fu (and vice versa, reinforces it) with -- where meaningful -- Vim integration and the convenience of not having to spam a terminal for one-off commands.

A mini.git that offers (only) this interface would be very appealing to me. (You could still create custom mappings for often-used commands, of course.) Benefit would be lower-latency vim.system implementation (fugitive can be quite slow if it has to process a lot of content into a buffer).

Funnily enough, this (having Neovim-tailored :Git command similar to 'vim-fugitive') is my ballpark goal right now. I think I would also like to see if adding blame/praise is feasible with small amount of code.

(Of course, my pipe dream is https://github.com/libgit2/luagit2 integration in Neovim...)

You and me both.

echasnovski avatar Feb 25 '24 13:02 echasnovski

With the release of mini.git I consider this issue (finally) resolved. Check out the new module and possibly leave feedback in #898. Thanks!

echasnovski avatar May 21 '24 15:05 echasnovski