问题
I was really excited to see VS Code finally added a minimap option for easier navigation. However, I've been really frustrated that the translucent rectangle showing your current location in a file only shows up when you hover over the minimap. A visual example of what I mean:
Without cursor: With cursor:
When using this feature in other editors, I find a lot of value comes from quickly seeing where I am in a file. Does anyone know if there is a setting/extension/hack that will keep the rectangle visible?
回答1:
From the stable version 1.14 (June 2017) there is an option in settings.json
:
"editor.minimap.showSlider": "always"
回答2:
It appears this is already being tracked in a feature request:
https://github.com/Microsoft/vscode/issues/21784
回答3:
I can't see a way to do it without building VS Code from source as it's just a small change to the minimap.css file of setting the opacity: 0; to opacity: 1;
.monaco-editor .minimap-slider {
opacity: 0;
transition: opacity 100ms linear;
}
I can't override the default css from the user settings with "editor.minimap-slider.opacity": 1,
But I am a noob at this kind of hack.
回答4:
Of interest to some may be that v1.43 added three new colorCustomizations
that affect the minimap slider color, including opacity (last two digits in the settings:
"workbench.colorCustomizations": {
"minimapSlider.background": "#ff000060",
"minimapSlider.hoverBackground": "#ff0000",
"minimapSlider.activeBackground": "#2f00ff50"
}
See https://github.com/microsoft/vscode/pull/90631 and https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_43.md#minimap-background-and-slider-colors
来源:https://stackoverflow.com/questions/42561099/vs-code-minimap-location-highlighting