How to change the selection for selected text and words / selections?

Visual confusion: color of selected text and selection of color selection

As a daily user of VS code, I discovered a previously closed problem ( selecting and choosing matching highlight color # 1636 ) about this - that is, if you actually select the selected text, but the highlight color is almost indistinguishable from the highlight used for the matched code or the same word.

Local user settings like CSS override?

If the system-wide highlight color (when choosing any text-wide system color) is not transferred to the VS-code, I need a way to edit it. Perhaps in the CSS theme or - preferably - in the user-created override css file or something (for example, in the VS Code user settings). Is it in the conveyor belt? If not, does anyone have a fix?

ATM changing the highlight color for the selected text seems impossible. I use "Dark", but the problem is the same no matter what the topic.

+10
source share
2 answers

Now there are many color settings that can be made for vscode, including selection options:

editor.selectionBackground: Color of the editor selection. editor.selectionHighlightBackground: Color for regions with the same content as the selection. editor.inactiveSelectionBackground: Color of the selection in an inactive editor. 

See vscode theme color options available from v1.13. I suppose.

+11
source

To complete a couple of missing steps:

  1. Open the settings.json file (the location of this file is indicated below)

  2. Add a comma to the last entry (before the closing bracket } )

  3. Paste in:

  "workbench.colorCustomizations": {
         "editor.selectionBackground": "# e788ff", // Current SELECTED text
         "editor.selectionHighlightBackground": "# ff0000", // same content as the selection
         "editor.findMatchBackground": "# 00cc44a8", // Current SEARCH MATCH
         "editor.findMatchHighlightBackground": "# ff7b00a1" // Other SEARCH MATCHES
     }

An example of a typical settings file, post mod:

  {
         "git.enableSmartCommit": true,
         "git.autofetch": true,
         "breadcrumbs.enabled": true,
         "git.confirmSync": false,
         "explorer.confirmDelete": false,
         "code-runner.saveFileBeforeRun": true,
         "code-runner.saveAllFilesBeforeRun": true,
         "workbench.activityBar.visible": true,
         "files.trimTrailingWhitespace": true,
         "telemetry.enableTelemetry": false,
         "workbench.colorCustomizations": {
             "editor.selectionBackground": "# e788ff7c", // Current selected text
             "editor.selectionHighlightBackground": "# ff00005b", // Same content as selection
             "editor.findMatchBackground": "# 00cc44a8", // Current SEARCH MATCH
             "editor.findMatchHighlightBackground": "# ff7b00a1" // Other SEARCH MATCHES
         }
     }


Where to find the settings.json file:

 Depending on your platform, the user settings file is located here: Windows %APPDATA%\Code\User\settings.json macOS $HOME/Library/Application Support/Code/User/settings.json Linux $HOME/.config/Code/User/settings.json 

ALTERNATE method to open settings.json file:

  1. Ctrl +, (comma) to open the settings

  2. Workbench

  3. Settings Editor

  4. At the top of the search box, paste workbench.colorCustomizations

  5. On the left, click Workbench and then Appearance

  6. Click on the link on the right: Edit in settings.json

Recommendations:

https://code.visualstudio.com/api/references/theme-color#editor-colors

https://code.visualstudio.com/docs/getstarted/themes#_customize-a-color-theme

https://code.visualstudio.com/docs/getstarted/settings

+6
source

Source: https://habr.com/ru/post/1258208/


All Articles