How to enable this Visual Studio Code vertical line? - visual-studio-code

This line appears when typing.
Screenshot of the image from an online video below.

Those are referred to as "diff decorations". You can control them by opening up your settings and searching for "diffDecorations".
You'll want to verify that scm.diffDecorations is set to either all or gutter. Additionally, as mentioned in the comments, you'll need to be using an SCM tool.

Related

How to hide/unhide comments with Microsoft VSCode?

I have a code with many comments, how can I hide these ones, but no delete, I need them after.
I need to hide all the comments in one click, not a simple collapse one
Can't find such feature as well.
Read this issue from GitHub - https://github.com/Microsoft/vscode/issues/46505
Seems like that VSCode can't do it (from the box) and all people waiting for that feature.
I was looking for a way to do that too as I put way too many comments making it hard to debug... and I came across this https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-hide-comments it makes all the comments invisible, but it leaves special characters in place. There are also commands to toggle show/hide.
Hide Comments - Visual Studio Marketplace
We now have an extension for that. On the editor title, a toggle action is available to show/hide the comments quickly.
You can download from inside Visual Studio 2022 called unobtrusive code and it will hide all comments and put "+" symbols on the collapsed line to the left of your code that you can open or close them with. It works great.
*** TO GET THE EXTENSION: ***
I went to the Extensions menu at the top of VS 2022 and chose manage extensions.
Then in the manage extensions window that opens up, choose online then Visual Studio Marketplace. In the search at the top right of the manage extensions window type in unobtrusive code. download it and then exit Visual Studio. You should see a window pop up to install it.
When you start VS 2022 again and open a C# script, it should have all the comments minimized to the "plus symbols" to the left of the code!
Hope it works for anyone wanting to hide their comments.

VS Code: How to move selection horizontally

In VS Code's github a move selection left and right sort of action has been proposed and implemented back in 2016.
Here's the issue on GitHub.
But I couldn't find the command.
The attached GIF shows clearly what I mean (I'm unfortunately still not allowed to upload images so here's the link)
Try set keyboard shortcut searching for Caret:

Removing Visual Studio Code current code block highlight

Does anyone know how to turn off the current code block highlighting, it only highlights the block of code you are currently editing. In the picture its the fun yellow line. I think it was added in 1.22.2
It's a feature of Bracket Pair Colorizer plugin that I think you're using. See the plugin's marketplace page for settings guide.

How to set up a minimap in VS Code?

I want to get an overview of my code and would like to use a minimap in VS Code.
I did not find an option to set this up in the menus. I am using VS Code 1.9.
Starting with version 1.10 (Feb 2017) vscode supports minimaps.
You can switch this function on via the preferences. Just follow these steps:
open vscode
File
Preferences
Settings
On the right pane you see your own custom settings. There you can add the following settings:
// Controls if the minimap is shown
"editor.minimap.enabled": true,
If this is the first setting you need to surround this with curly brackets and remove the tailing comme. If you have already one or more please keep in mind this is JSON so you need to separate key:values with a comma.
Adding the following to settings.json will also highlight where you are on the map:
"editor.minimap.showSlider": "always"
Additionally, to render blocks instead of characters for better visualization in the Minimap:
"editor.minimap.renderCharacters":false
You have to update to version 1.10+ and add "editor.minimap.enabled": true to your user or workspace settings, which can be opened with Ctrl+,.
Since the questions is "how to configure it" I will give what I've found is the most useful configuration of the minimap feature.
This is how it looks in my editor:
This is effectively about 1/3 height and only the first 40 columns. But still just readable. It makes it so I can quickly grab the minimap slider and scrub through a file.
Here is my minimap config:
In current VS Code versions, you can simply enable and disable minimap under view->Show minimap.This is reference from Visual studio code version 1.55.2. This way we don't need to edit json settings file.

vscode on mac is incorrectly highlighting text around text blocks

It is very annoying to see that background around code is lighter then the rest of the program. When the cursor moves the highlighting moves up and down to full window width. Can you please propose solution how to turn this highlighting off. Same problem is in output of task log, and in file explorer.
I have deleted all the settings and Application data and I have same problem. I have installed vscode on windows and I do not have this problem with same settings.
Unfortunately this is an issue in Chromium. You can work around this by starting VS Code with --disable-gpu from the command line.
Sean
It appears this can be fixed for some users by selecting a different color profile in macOS display settings. Note that you have to change this separately for all monitors that you use.
For me, "Apple RGB" will show these blocks, and switching to "LED Cinema Display" or "iMac" solves the issue.
See also: https://github.com/Microsoft/vscode/issues/12473#issuecomment-269024219