sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.6k stars 101 forks source link

[Feature] File name on the top of the diff window #391

Closed briandipalma closed 1 year ago

briandipalma commented 1 year ago

Description

Doubt this can be done but thought it was worth asking. To reduce the amount of looking back and forwards from the file panel to the diff panel it would be nice to have the filename fully across the top of the diff window. As a header basically. Something like this:

image

Expected behavior

No response

Actual behavior

.

Steps to reproduce

.

Health check

.

Log info

No response

Neovim version

.

Operating system and version

.

Minimal config

No response

sindrets commented 1 year ago

There's already a way to enable this if you're on nvim ≥ v0.8:

require("diffview").setup({
  view = {
    default = {
      winbar_info = true,
    },
    file_history = {
      winbar_info = true,
    },
  },
})
briandipalma commented 1 year ago

You need to focus into the file in the diff splits though. It only goes across the top of one of the splits too which makes it cramped and it's the same value in every split so I feel it makes sense for it to be a header over all the splits. My ideal workflow is to be able to quickly move over all the diffs without having to focus in on the split panel while keeping my eyes on the split panel. Moving from change to change/file to file is why I asked for the [c and ]c bindings. And the header means you wouldn't have to scan the file list to figure out where you are in a large review.

sindrets commented 1 year ago

You need to focus into the file in the diff splits though. It only goes across the top of one of the splits too [...]

No, this is not the default behavior. You likely have plugins interfering with the winbar. By default it should look more like this:

2023-07-10-194028_maim

It shows the Git object name in the winbar of each of the diffed buffers. You don't have to focus the window for the winbar to show up.

[...] so I feel it makes sense for it to be a header over all the splits

As in one single header that spans multiple windows? That's not something I'm interested in working on. I'm not convinced it's sufficiently more useful than what we can already do with the builtin winbar.

In my own setup I use my own custom winbar that gives me the information I need at a glance:

image

briandipalma commented 1 year ago

Correct my config for lualine was causing it not to appear. Sorry for the bother.