Skip to content

Allow cusomizing the hotkey that shows/hides inlay hints #149019

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

Open
HolyBlackCat opened this issue May 8, 2022 · 9 comments
Open

Allow cusomizing the hotkey that shows/hides inlay hints #149019

HolyBlackCat opened this issue May 8, 2022 · 9 comments
Assignees
Labels
feature-request Request for new features or functionality inlay-hints
Milestone

Comments

@HolyBlackCat
Copy link

Currently the setting "editor.inlayHints.enabled": "{on,off}UnlessPressed", forces you to use CtrlAlt to show/hide the inlay hints.

I think it would be great to support customizing this hotkey, for example I'd bind one of the F keys to it.

@jrieken jrieken added feature-request Request for new features or functionality snippets labels May 9, 2022
@jrieken jrieken added this to the Backlog milestone May 9, 2022
@crumblingstatue

This comment was marked as spam.

@wesbos
Copy link

wesbos commented Dec 19, 2022

Yes, this would be amazing to have. Currently I have them set to offUnlessPressed, but I sometimes want to turn them on - because I'm teaching or need a screenshot.

A command to toggle them on, and then back to off / offUtillPressed would be very helpful.

@eduarddejong
Copy link

eduarddejong commented Dec 20, 2022

Would be great, because in VS Code on my system Ctrl+Alt activates the menu bar, places the focus there (I have just enabled the feature, I don't know how normal this is? So I don't know about this on Windows yet). Seems kinda buggy to me (especially because other applications do not show this behaviour on my system).
I am working on the Xfce desktop on Linux. I believe not so many people are working with VS Code here or are testing it here.

@burner1024
Copy link

burner1024 commented Jan 1, 2023

I've tried this feature for 15 minutes, and my hand already hurts. Ctrl-Alt is an ok combination to press once, but for holding it's terrible.
The losing focus issue also doesn't increase happiness. You can keep focus by using Alt-Ctrl instead of Ctrl-Alt, but this is even more awkward.

In addition, or as an alternative to customizing this hotkey, maybe consider adding a proper hotkey that allows to toggle the hints, rather than require to hold.

@ObstinateM

This comment was marked as spam.

@daira
Copy link

daira commented Jun 28, 2024

I don't see why this wasn't a toggle in the first place. Type hints are most useful when you actually have a type error, or want to refactor the types, or are trying to understand someone else's code. Those are activities that take up a low proportion of my time overall, but when I'm doing them I don't want to have to hold down an awkward key combination, which prevents actually modifying the code while (after a short delay) seeing the hints!

@starball5
Copy link

@onelaview
Copy link

onelaview commented Sep 21, 2024

TL;DR - I think my problem would be solved if I can customize the show/hide inlay shortcut to some other key combination to avoid conflicting with my HYPER key setup.

I'm on MacOS and my keyboard workflow heavily relies upon the HYPER key using Karabiner-Elements. And my setup is using Left Shift + Right Control + Right Option as the HYPER key. In VS Code, I have set the editor.inlayHints.enabled to offUnlessPressed.

As you can see, because the the show/hide inlay shortcut is also using Control + Option so it's somewhat conflicting with my HYPER key setup. This means that every time I use my HYPER key, it also triggers the inlay hints causing text in the editor flashing/flickering.

For example, in this video I have HYPER + I mapped to Arrow Up and HYPER + K mapped to Arrow Down key for moving cursor. When I move cursor using HYPER key, the text in the editor area flashes.

Screen.Recording.2024-09-21.at.11.34.19.mov

Video Recorded from

  • MacOS Sonoma 14.6.1
  • VS Code Version: 1.93.1 Commit: 38c31bc

@Ilanaya
Copy link
Contributor

Ilanaya commented Apr 9, 2025

The other issue is that ctrl + alt for toggling inlay hints forces you to open the type definition on the side

Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.

This is very annoying as I usually want to jump directly to the definition. AFAIK there is currently no way to get the desired behaviour unless I'll use "editor.inlayHints.enabled": "on"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality inlay-hints
Projects
None yet
Development

No branches or pull requests