gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
9.02k stars 1.34k forks source link

Custom width of on the `git blame` sidebar #2668

Open vthemelis opened 1 year ago

vthemelis commented 1 year ago

At the moment, it looks like once I open the git blame side bar on VS Code, it looks like it's occupying about half of the available horizontal space.

As far as I can tell, there is no draggable barrier to reduce the width of the side bar or a setting to permanently reduce the size.

It would be very useful to be able to see a narrower view of the side bar.

eamodio commented 1 year ago

Unfortunately, there isn't a way for GitLens (or any VS Code extension) to provide that type of ability. I would LOVE it though.

eamodio commented 1 year ago

I should have also mentioned that while you can't drag/resize the blame dynamically, you can control the content and size via settings.

You can control the Annotation format:

image

And here are the custom formatting docs: https://github.com/gitkraken/vscode-gitlens/wiki/Custom-Formatting

vthemelis commented 1 year ago

Thanks a lot for the quick response! Is there an open issue on the VS Code side?

eamodio commented 1 year ago

There isn't something specific to point to, because the GL blame feature is basically "hacked" into the VS Code editor there isn't an easy/clear place to make it something more supported. There have been proposals in the past, most if not all, have been closed as "out of scope" by the VS Code team. The closest one that might be helpful (though today the proposal is anchored to a line rather than a document edge) is the editor insets proposal: https://github.com/microsoft/vscode/issues/85682. But that has basically stalled out in 2020.

sweidac commented 1 year ago

I might be nuts, but didn't the resize work two weeks ago? Or did just the default width change?

eamodio commented 1 year ago

Other than via the gitlens.blame.format setting there isn't a way to control the width of the blame "gutter". And there shouldn't have been any change in the default gitlens.blame.format which is "${message|50?} ${agoOrDate|14-}" which takes up about ~64 characters.

@sweidac are you running the pre-release version of GitLens? If so, then maybe there are bugs in the new parser for the gitlens.blame.format setting (and other formats). If you are running the pre-release please let me know and can you also send the value of your gitlens.blame.format setting -- thanks!

sweidac commented 1 year ago

The default git.blame.format was ${message|50?} ${agoOrDate|14-}. I changed the width of the message to 20 characters to make it narrower. I actually tried the pre-release version, but only to see whether the wide gutter was already fixed there, but without success.

I remember playing around with trading window.scaling vs editor.fontSize around when the issue occured, but I can't achieve the narrow gutter when playing with these settings. I feels unlikely that this is the cause.

josephecombs commented 1 year ago

best I could do to get this taking up less space is changing Gitlens › Blame: Format to:

${author|10?} ${date|10?}
ofrnsb commented 11 months ago

is there any way to reduce the space between code and git blame information? it takes too much space IMHO

jasonvarga commented 9 months ago

Is it possible to adjust the date formatting from 5 days ago/1 year ago to something like 5d/1y?

Thank you for the recommendation on formatting these strings. Trimming the message down to 20 makes a huge difference.

xtina commented 9 months ago

Hello, adding onto this... Is it possible to modify the font or font size? That could possibly help with width issues.

eamodio commented 9 months ago

@ofrnsb there currently isn't an option to reduce the spacing there -- it currently matches the spacing between the gutter and the code.

@jasonvarga You can set "gitlens.blame.format": "${message|20?} ${agoOrDateShort|4-}", which will shorten up the date.

@xtina opened https://github.com/gitkraken/vscode-gitlens/issues/3134

Aubermean commented 2 months ago

@ofrnsb there currently isn't an option to reduce the spacing there -- it currently matches the spacing between the gutter and the code.

@jasonvarga You can set "gitlens.blame.format": "${message|20?} ${agoOrDateShort|4-}", which will shorten up the date.

@xtina opened #3134

If screen real estate is at a premium, it helps to set a Mono Compressed or Mono Condensed font too, like "gitlens.blame.fontFamily": "Input Mono Compressed" and to disable avatars as well ("gitlens.blame.avatars": false).

Here, I have chosen also a bold font weight:

image

The before and after is quite significant... defaults were taking up 1/3 of my screen on a 13inch Macbook...

image

All together:

{
  "gitlens.blame.format": "${message|20?} ${agoOrDateShort|4-}",
  "gitlens.blame.fontWeight": "bold",
  "gitlens.blame.fontFamily": "Input Mono Compressed",
  "gitlens.blame.avatars": false
}
quicknir commented 1 month ago

Lots of helpful tips here; thanks to everyone! One idea for how gitlens cold better work around this issue - you could have both a "concise" and "verbose" blame.format, and have a command "GitLens: toggle blame verbosity". I feel like being able to switch between the ~25 character and ~55 character blame easily would probably be quite a comfortable workflow for people.