Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom width of on the git blame sidebar #2668

Open
vthemelis opened this issue May 10, 2023 · 15 comments
Open

Custom width of on the git blame sidebar #2668

vthemelis opened this issue May 10, 2023 · 15 comments
Labels
blocked: vscode Caused by or dependent on a VS Code issue or feature blocked Blocked or caused by an upstream issue or feature feature New feature or request

Comments

@vthemelis
Copy link

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.

@vthemelis vthemelis added feature New feature or request triage Needs to be looked at labels May 10, 2023
@eamodio
Copy link
Member

eamodio commented May 10, 2023

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 eamodio added blocked: vscode Caused by or dependent on a VS Code issue or feature blocked Blocked or caused by an upstream issue or feature and removed triage Needs to be looked at labels May 10, 2023
@eamodio
Copy link
Member

eamodio commented May 10, 2023

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
Copy link
Author

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

@eamodio
Copy link
Member

eamodio commented May 10, 2023

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: microsoft/vscode#85682. But that has basically stalled out in 2020.

@sweidac
Copy link

sweidac commented May 24, 2023

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

@eamodio
Copy link
Member

eamodio commented May 24, 2023

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
Copy link

sweidac commented May 24, 2023

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
Copy link

josephecombs commented Sep 20, 2023

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

${author|10?} ${date|10?}

@ofrnsb
Copy link

ofrnsb commented Dec 14, 2023

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

@jasonvarga
Copy link

jasonvarga commented Feb 2, 2024

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
Copy link

xtina commented Feb 2, 2024

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

@eamodio
Copy link
Member

eamodio commented Feb 4, 2024

@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

@Aubermean
Copy link

Aubermean commented Sep 4, 2024

@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
Copy link

quicknir commented Oct 7, 2024

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.

@nilsbunger
Copy link

A good free font alternative that's similarly narrow - maybe even more narrow - is Ubuntu Mono.

All together:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: vscode Caused by or dependent on a VS Code issue or feature blocked Blocked or caused by an upstream issue or feature feature New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants