tpope / vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
https://www.vim.org/scripts/script.php?script_id=2975
19.75k stars 1k forks source link

Inline commit stats. #1943

Open bogado-mylio opened 2 years ago

bogado-mylio commented 2 years ago

It would be very nice to be able to expand commit lines with a summary information :

Example

Head: master
Merge: origin/ypsum
Push: origin/master
Help: g?

Unstaged (2)
M loren.ypsum
| @@ -3,9 +3,6 @@ local nvim_lsp = require('lspconfig')
|  Pellentesque porta odio ut nisl sagittis,
| +Aenean placerat sapien vel viverra vestibulum.
| -Aenean placerat sapien vel viverra vesibulum.
\---------------------------------------------------------
M aliquam/quaerat.volum

Unpushed to origin/mylio-linux (1)
8c29b2e Cras augue leo, venenatis ac blandit a, tincidunt sed metus. 

Unpushed to origin/master (11)
8c29b2e Donec sagittis, sapien et pulvinar commodo.
| commit 8c29b2eb003e2c5f35e96d839505cb0cf24f204e (HEAD -> master)
| Author: Victor Bogado da Silva Lins <victor@mylio.com>
| Date:   Tue Feb 1 14:04:38 2022 -0800
| 
|     Move lua code to a lua file
| 
|  applications/vim.app/xdgConfig/nvim/lsp_nvim.lua | 3 +++
|  applications/vim.app/xdgConfig/nvim/lsp_nvim.vim | 4 --++
\-----------------------------------------------------------------
6890114 nibh enim aliquet odio, nec ultrices diam felis et eros.
c6a0e9d Duis quis commodo enim.
0a1623d Pellentesque porta odio ut nisl sagittis.

In this example I've used some decorations to help differentiate the inlined content from it's parent. It may also be helpful in order to generalize the logic on that recognizes the inlined content to more general content than diffs.

wookayin commented 8 months ago

~Press = on the line (or any "visual block" range). See :help fugitive_=~ sorry, nvm; I now see that you are referring to "commit states" not individual files.