NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
3.71k stars 221 forks source link

A lua api to open Commit view #1288

Closed ptn closed 2 months ago

ptn commented 2 months ago

Is your feature request related to a problem? Please describe. I use a different plugin for blaming files, and I still use the old Gina written in vimscript as it has an incomparable git log implementation that uses streaming. I would like to be able to assign a mapping to these other plugins where pressing Enter opens Neogit's commit view.

Describe the solution you'd like Something like neogit.open("commit", $commit_hash) - or whatever really.

Describe alternatives you've considered

Additional context

CKolkey commented 2 months ago

I might add a more public api for this at some point, but for now (and the forseeable future) this will work:

require("neogit.buffers.commit_view").new("<hash>"):open()

The open() method can optionally take a string for what kind of buffer to create, like "split", "vsplit", etc.

ptn commented 2 months ago

Like a charm! This to me is enough and I don't think we need a "more public api".

Thanks.