When VS Code is used as a diff tool, e.g. with git difftool, it shows changed lines in red and green. Is there a way to highlight the changed characters (in addition to or instead of the lines) so that they stand out more?
VS Code git diff actually does have character highlighting. It's just very subtle, so it may not be noticeable.
You can modify the diff color settings to find one that allows for more contrast. Make sure the color specifies the alpha channel, otherwise it won't work.
settings.json
"workbench.colorCustomizations": {
"diffEditor.insertedTextBackground": "#00bb0044",
"diffEditor.removedTextBackground": "#ff000044",
},
For more info, see How to change diff color Visual Studio Code
Related
In this situation,
When I add newline at if (level >= curr_log_level),
at this setting,
It becomes
If I try other Editor: Auto Indent preferences, (keep, brackets, advanced, full), all the four settings give:
I don't want this either, what I want is:
I tried many different settings that VS Code offers,
but I couldn't find something that does what I want to do exactly.
CLion provided such formatting, but its debugging is too slow so I'm switching to VS Code.
Is there such formatting option?
If not, how can I customize formatting?
Is there any way to stop the full line highlight in versions control?
It is very confusing when the vscode is highlighting the full line and not only the changed piece of code especially when there is a lot of changes.
vscode vs sublime merge line highlight
Some related issues: https://github.com/microsoft/vscode/issues/116413
https://github.com/microsoft/vscode/issues/103207
https://github.com/microsoft/vscode/issues/66223
Upvote these - especially the first which is in the candidate phase.
You can play around with these colorCustomizations in your settings.jsonwhich might help a "little":
{
"workbench.colorCustomizations": {
"diffEditor.insertedTextBorder": "#0f0",
"diffEditor.insertedTextBackground": "#0000", // set to transparent
"diffEditor.removedTextBackground": "#0000", // set to transparent
"diffEditor.removedTextBorder": "#f00"
}
But these changes don't help much in my opinion. Upvoting is probably your best bet.
Latest update of VS Code changed color of at least one element I had customized for js via settings.json (entity.name.function.js). The color is changed for keywords like resolve, then, reject, bind, but not all function names(!). Other of my custom colors seem to remain unaffected. I did not change anything in the settings.json.
When I open the Developer: Inspect Editor Tokens and Scope option and select the elements of the code with incorrect color I see:
foreground entity.name.function.js { "foreground": "#9493DA" }
which suggests the custom color definition is recognized by VS Code, but not applied for some reason.
What can be the reason and how to make VS Code apply the desired styling?
Apparently the update changed classification of some keywords from support.function.js to support.function. After adding the latter to settings.json color was applied properly.
When I place my cursor on the extremity of a block (represented by the white drawn cursor on the picture below) VSC highlight both the ending and the starting symbol of that block.
The red line on the picture represent the starting and the ending of that block. Where can I set the option for VSC to automatically use a background color to highlight the current selected block ? (I am really more of a visual guy and I like to feel where's my current locations when I am coding.)
You are going to need an extension to do that, it isn't built-in. Try:
Indented Block Highlighting
I am not sure it supports all languages but see if it works in your case.
Bracket-pair-colorizer does something similar but more subtle. See "bracket-pair-colorizer-2.showHorizontalScopeLine".
.
And see How to change indent guide line color between brackets in VSCODE? - perhaps highlighting the active indent guide will be enough for you?
Using (in your settings.json):
"workbench.colorCustomizations": {
"editorIndentGuide.background": "#bbb",
"editorIndentGuide.activeBackground": "#f00e0e",\
}
How do I change the horizontal letter spacing in VS Code?
I'd like to reduce it a little, in other words, I want to change this:
to this:
As of VS Code 1.13, there is an "editor.letterSpacing" setting.
For example, I'm using the following code in my settings to tighten up the letter spacing ever so slightly:
{
"editor.letterSpacing": -0.15
}
I actually just went the opposite way after installing the wonderful Victor Mono font which I found to be too narrow and wanted to expand the kerning.
I was able to set this by simply searching in the User Settings (CTRL+SHIFT+P) for spacing and there are two separate boxes that were set to 0 for terminal and editor. You can change the value and see it update live, which is really cool.
This is as of my current version of VS Code 1.39.2 on Mac OS Mojave.
I set my terminal to 1 and the editor to 0.7 and it looks amazing now and all is right with the world.