Change visual studio caret color

前端 未结 6 1657
粉色の甜心
粉色の甜心 2020-12-29 19:44

I am trying the new Visual Studio 2012 dark theme. When moving the mouse of code I cannot see the cursor, since the code background is black and the mouse cursor is black.

相关标签:
6条回答
  • 2020-12-29 19:59

    On a Windows 10 level there is a solution for the cursor/indicator/caret with some swag in the form of :

    https://www.tenforums.com/tutorials/137454-change-text-cursor-indicator-color-windows-10-a.html

    For Visual Studio specifically:

    1. Install the extension Color Theme Editor for Visual Studio 2019 from the market: LINK or from within the VS itself --> Extensions --> Manage --> Online (Use the search bar)
    2. When this extension is installed open it from within VS by --> Tool --> Customize Colors and then use the search for key word "caret" and change the Foreground and Background colors of the indicator/cursor/caret.

    Example: Text Editor -> VsVim Block Caret -> Background

    INFO: Look at the image for more guidance (the search bar is to the right of the save; save and apply icons... outside of the screenshot):

    0 讨论(0)
  • 2020-12-29 20:08

    I could not see the blinking cursor due to a black background as well. The fix in Visual Studio 2017 was to set the Item forground and background colors different.

    Tools > Options > Environment > Fonts and Colors > Show settings for: Text Editor > Display items: Plain Text

    It seems the cursor color takes its cue from Item foreground.

    0 讨论(0)
  • 2020-12-29 20:16

    In Windows 7 I resolved this by modifying my Windows system settings to use the Windows Black (system scheme). The caret I-Beam shape is surrounded by a white stroke that stands out over dark backgrounds and invisible over pure white backgrounds.

    Go to Control Panel-->Appearance-->Ease of Access-->Make the mouse easier to use

    and choose "Regular Black"

    You would think that that the Inverted option would work, but the color remains black over the dark greys of the VS 2012 dark theme. The Regular Black does work well though.

    0 讨论(0)
  • 2020-12-29 20:19

    A solution I've found for macOS (up to Mojave) is to modify the VS Code core files.

    Open the file /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.css.

    Paste in this CSS in that file, doesn't matter where:

    .monaco-editor.vs-dark .view-lines {
        cursor: -webkit-image-set(url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII=') 1x, url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC') 2x) 5 8, text;
    }
    

    (source)

    This could be done manually, with a shell script, or with an extension like the Custom CSS and JS Loader.

    Restart VS Code. You'll see a warning about Code being corrupted. You can resolve those using the Fix VSCode Checksums extension.

    0 讨论(0)
  • 2020-12-29 20:20

    Changed my select caret to a custom green caret. Now I can always see it, even against the black vs background.

    0 讨论(0)
  • 2020-12-29 20:21

    Just change the Text Select of the mouse to 'Windows Black'

    0 讨论(0)
提交回复
热议问题