Tuesday, August 2, 2016

Color settings in VS2015

After working years and years on computer, it's time to adjust the color in VS2015. This can be done by selecting Options from Tools menu. Then, look for "Fonts and Colors" under Environment and you may start editing the colors for "Text Edit":

  • Plan text - adjust the background color to RGB(228, 228, 228)
I'm adjusting the background color to green color for the following options:
  • Brace Matching RGB(0, 185, 0)
  • Brace Matching (Rectangle) RGB(0, 128, 0)
  • Hightlighted Definition RGB(185, 194, 154)
  • Hightlighted Reference RGB(249, 182, 100)
You may have to adjust the text color to any color that you like:
  • Preprocessor keyword
  • User Types - xxx
You may also need these add-on:

ColorThemeEditor.vsix - to change the VS color scheme.

https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.VisualStudio2015ColorThemeEditor

VisualCommander_263.vsix - to automate some text to be injected and binding the command to shortcut key.

https://marketplace.visualstudio.com/items?itemName=SergeyVlasov.VisualCommander

Sample code to inject current date, time & my name to the text editor:

Sub Run(DTE As EnvDTE80.DTE2, package As Microsoft.VisualStudio.Shell.Package) Implements VisualCommanderExt.ICommand.Run

        Dim textSelection As EnvDTE.TextSelection
        textSelection = CType(DTE.ActiveDocument.Selection(), EnvDTE.TextSelection)
        textSelection.Text = "//" + System.DateTime.Now.ToString("d.MMM.yy") + ", myName-"

    End Sub

Don't forget to customize the "keyboard" and bind it to any shortcut that you like. As for myself, I reset CTRL+[0 to 9] and bind it with my command.