Is there a way to disable selection highlighting in VS Code? - visual-studio-code

Is there a way to disable this multi selecting in VS Code?

There are 3 settings you can configure to disable this.
1. Selection Highlight
"editor.selectionHighlight": false,
When you selected "open" (as in drag your cursor around the word), it also highlights all the "open"'s in the same file. You can disable this behavior from the settings UI or from the JSON file.
2. Occurences Highlight
"editor.occurrencesHighlight": false
This is supposed to prevent selecting all occurrences of a word when you click on it (i.e. when you click on "open", it should not highlight all the other "open"'s).
But, it can be a bit unreliable. It depends on the language and whether you have language-specific extensions installed that does not override it. See the discussion on it here: https://github.com/Microsoft/vscode/issues/5351
3. Selection Highlight Background
This last way is a bit of brute-force solution. You can change the color of the selection highlight to be transparent. (Technically, it would still be highlighted but you just won't see it.)
"workbench.colorCustomizations": {
"editor.selectionHighlightBackground": "#00000000",
}

Related

How to remove spotlighted lines in VSCode [duplicate]

The Visual Studio editor highlights the current line by changing the background color of the current line. Is there a simple way to disable this highlighting? Otherwise, which parameter in Fonts and Colors dialog controls the background color of the currently selected line in the editor?
Is there a simple way to disable this highlighting?
Tools -> Options -> Text Editor, in the Display group, uncheck "Highlight current line"
Which parameter in Fonts and Colors dialog controls the background color of the currently selected line in the editor?
The colors are named "Highlight Current Line (Active)" and "Highlight Current Line (Inactive)"
To disable the border around the current line
In VS 2019
Go to : Environment -> Fonts and Colors:
Find the display item: Highlight Current Line
Set the item foreground color to: Automatic
In VS 2017 and earlier
Go to : Tools -> Options -> Text Editor:
Find the display items:
Highlight Current Line (Active)
Highlight Current Line (Inactive)
Set the item foreground color to: Automatic
if its visual code make
"editor.renderLineHighlight": "none"
The Visual Studio editor highlights the current line by changing the background color of the current line.
The only time I've seen this is when "Use Windows High Contrast settings" is enabled (Options > Environment > General)
With this setting disabled, I just get a subtle grey box to indicate the current line (this may depend on your Color Theme):
If you're using Resharper, it's:
Tools -> Options -> Text Editor:
ReSharper Current Line Highlight
press -> Ctrl + comma
Search => Render Line Highlight
select none from the options
In addition to the previous answer, I'd like to mention that Visual Assist (the tomato icon) also have an highlight current line feature, that can still be active while your Visual Studio highlight option is turned off.
This drove me crazy! Find it in Visual Assist Option panel, Display category.
So don't forget to also uncheck the VisualAssist highlight option.
edit
my settings:
Visual Assist option turned off
Visual Studio option turned on (in the Text Editors part)
In the font color settings, for Highlight current line (active and inactive), set the foreground to Automatic
Finally you can set your highlight color as you want with the background color.
Last point, sometimes Visual Studio mess things up even more, you may have to restart it, or close/open your tabs... sadly, YMMV.
For VsCode 2021 version users
Workspace > Text-Editor > Render Line Highlight > none
Visual assist and vsvim extensions were conflicting. So I disabled it within the visual assist options.
Uncheck the option: Highlighting->Highlight results of Quick Find and Find in Files.
For some reason "esc" doesn't work .

change background of the currently open file tab in vscode [duplicate]

Does VSCode provide a way of highlighting the current editor group (or tab) in focus?
For example:
Highlighting a bounding box around the group in focus with a separate color (illustration below)
Highlighting the current tab in the group in focus
for modifying the active tab see https://code.visualstudio.com/api/references/theme-color#editor-groups-tabs. For example:
tab.activeBackground, tab.activeForeground and there a few more active/inactive color settings to modify in that link. They go in your settings colorCustomizations object like:
"workbench.colorCustomizations": {
"tab.activeBackground": "#ff0"
}
In general, https://code.visualstudio.com/api/references/theme-color is the resource for looking up what items can be modified in this way.
It doesn't look there is a way to differentiate an active from an inactive editorGroup except for a focused but empty editorGroup, with editorGroup.focusedEmptyBorder. You might find some other editorGroup colors useful though.
By using tab.unfocusedActiveBackground you can highlight inderectly the current active editor group:
"workbench.colorCustomizations": {
"tab.activeBackground": "#770000",
"tab.unfocusedActiveBackground": "#000033"
}
It is the best I have found yet.
View here

Can barely see vscode editor tab [duplicate]

Does VSCode provide a way of highlighting the current editor group (or tab) in focus?
For example:
Highlighting a bounding box around the group in focus with a separate color (illustration below)
Highlighting the current tab in the group in focus
for modifying the active tab see https://code.visualstudio.com/api/references/theme-color#editor-groups-tabs. For example:
tab.activeBackground, tab.activeForeground and there a few more active/inactive color settings to modify in that link. They go in your settings colorCustomizations object like:
"workbench.colorCustomizations": {
"tab.activeBackground": "#ff0"
}
In general, https://code.visualstudio.com/api/references/theme-color is the resource for looking up what items can be modified in this way.
It doesn't look there is a way to differentiate an active from an inactive editorGroup except for a focused but empty editorGroup, with editorGroup.focusedEmptyBorder. You might find some other editorGroup colors useful though.
By using tab.unfocusedActiveBackground you can highlight inderectly the current active editor group:
"workbench.colorCustomizations": {
"tab.activeBackground": "#770000",
"tab.unfocusedActiveBackground": "#000033"
}
It is the best I have found yet.
View here

Make the code folding icons always show in Visual Studio Code

Loving using Visual Studio Code but one peeve is that I always think my code isn't indented properly since the left edge of the actual editor is kind of far from the numbers.
Is there any way to show the code folding +/- icons by default? It only shows them if you hover over the gutter.
As an aside, if there is a way to change the color of the gutter so it looks distinct from the editor?
To change the color of the gutter, you can add following to the user settings:
"workbench.colorCustomizations": {
"editorGutter.background": "#abcdef"
}
And to show folding icons:
"editor.showFoldingControls": "always"
Note that this setting requires you to have at least 1.13.
You cannot make code folding icons appear persistently. It is discussed here on project github page however it is not implemented yet.
If you want proper indentation your best bet is indentation guides (the vertical lines that run down to matching indents).
Indentation guides are not displayed by default.To enable indent guides go to File --> Preferences --> Settings and then place following line in settings.json file,
"editor.renderIndentGuides": true
you can make code folding icons appear persistently by addding :
"editor.showFoldingControls": "always",
but not in the "workbench.colorCustomizations", just put it outside and it will work.
example:
"editor.showFoldingControls": "always",
"workbench.colorCustomizations": {
"editor.renderIndentGuides": true,
"scrollbarSlider.background": "#474552",
"scrollbarSlider.hoverBackground": "#295377",
},
and since the [+][-] icons were replaced with [>][v], you can use this extension to regain this feature: Minimalist Product Icon Theme
I know this is an old thread, but FWIW:
File > Preferences > Settings
User > Text Editor > Editor: Show Folding Controls
Select "Always"

How do I turn on text wrapping by default in VS Code

Usually when I use VS Code, very first thing I do on new document is command: "Toggle Word Wrap" or Alt+Z. I tried looking into User Settings, but I didn't find any relevant entries. Is there some way to have text wrapping 'on' for every document by default?
The setting is now "editor.wordWrap": "on", which should be set to "on" (the default value is "off").
Switching to "on" activates word wrap on all documents in Visual Studio Code.
See the release notes about Word Wrap changes for more info.
Version 1.32.3
If you don't want to edit any files you can just turn it on under user settings:
Code > Preferences > Settings > Text Editor
Type "wordwrap" in the search or scroll to bottom of the list just before the cursor section. You'll see it as "Word Wrap / Controls how lines should wrap."
Have a look at the setting editor.wrappingColumn (see the docs for more information)
Update 2017-04-06:
Recently the setting changed (see here) to editor.wordWrap with several options:
We therefore decided to deprecate editor.wrappingColumn (with its -1,
0, >0 cases) in favor of editor.wordWrap.
Here are the new word wrap options:
editor.wordWrap: "off" - Lines will never wrap.
editor.wordWrap: "on" - Lines will wrap at viewport width.
editor.wordWrap: "wordWrapColumn" - Lines will wrap at the value of editor.wordWrapColumn.
editor.wordWrap: "bounded" - Lines will wrap at the minimum of viewport width and the value of editor.wordWrapColumn.
In 2020, here are simple steps to do it.
Click on 'File' on the top menu.
Click on 'Preferences' --> 'Settings'.
Scroll a little bit until you find 'Editor: Word Wrap'.
Click on the dropdown menu and choose 'on'.
Done. Settings will be saved by default.
Hope this helps.
So easy. This solution worked for me.
Click on 'File' on the top menu.
Click on 'Preferences' --> 'Settings'.
Search Word Wrap in the search box then you will see Editor: Word Wrap.
Click on the dropdown menu and choose 'on'.
It will definitely work.
Thank You.
Firstly go to the setting-> the search on search box word wrap-> then on the word wrap option.
Open User Settings Json and add ( As shown in the image below)
"editor.wordWrap": "on",
Press ctrl + , from the keyboard.
This will take you to the settings tab.
Type word wrap in the search tab.
Click on Editor: Word Wrap drop down.
Select on.
You are done.
See the image and follow the red boxes.
caw5v's answer mentions that word wrapping would not work if accessibility is on.
But that will change with VSCode 1.73 (Oct. 2022):
We disable word wrap when accessibility is turned on.
I would remove this limitation due to three reasons
User feedback
Now the status bar is accessible and Ctrl + g announces line number so it is much easier to figure out what line you are on
WordWrap is off by default if the user turns it on he or she should be aware of it
This is now the new policy available today in VSCode Insiders:
If you activate Word Wrap, it will be active even if Accessibility mode is on.
For those still having issues, make sure to check if 'Accessibility Support' is on. While "on" word wrapping can be disabled if a screen reader is detected.
settings > user&workspace > accessibility support
This worked for me. I run two additional monitors, however, I use an m1 macbookpro so support for two monitors is not available. To solve this I use a displaylink connection. Vscode appears to identify my displaylink connection as an accessibility screen reader.