Difference: VisualStudioTweaks ( vs. 1)

Revision 12020-07-01 - RobinWatts

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="GitPolicies"

Visual Studio Tweaks

This page documents some tweaks to Visual Studio that I find very useful.

These are primarily targetted at VS2019, but many work with older versions too.

Whitespace.

Trailing whitespace visualisation

Extensions -> Manage Extensions -> Search for Visualize Trailing Whitespace. Install that, restart VS. Any trailing whitespace (other than the line you are currently editing) shows up as red. You can edit the color in Tools -> Options -> Environment -> Fonts and Colors -> Text Editor -> Trailing Whitespace.

Removing trailing whitespace

Extensions -> Manage Extensions -> Search for "RemoveTrailingWhitespaces". That will give you a menu option to remove trailing whitespace from a file (Edit -> Advanced -> Remove Trailing Whitespace). It can be set to run automatically whenever a file is saved (Tools -> Options -> Remove Trailing Whitespaces -> Options -> Remove trailing whitespace on save = true).

Visualizing Tabs vs Spaces

Tools -> Options -> Text Editor -> General -> Display -> Tick "View whitespace". This causes tabs and spaces to appear visibly. I find the default setting for this to be a bit too visible for my taste, so I also set: Tools -> Options -> Environment -> Fonts and Colors -> Text Editor -> Visible White Space - > set foreground to silver. That makes whitespace visible enough, but not glaring.

Guidelines.

I like to know when my lines are getting past 72 (and at a push, 80) chars. I use an extension to add 'guidelines' to the display for this. Extensions -> Manage Extensions -> Search for "Editor Guidelines". Details of how to configure it are here.

Scroll bar

Previous versions of VS have had extensions to give a 'map' of the code in place of the scrollbar (metascroll? metalscroll? etc). In VS2019, click the right hand mouse on the scrollbar of a source file, and choose "Scroll Bar Options...". That will take you to the right place in the Text Editor options. You can choose 'bar mode' or 'map mode' for all windows. Personally, I have 'map mode' enabled for C/C++.

Swapping between GS and MuPDF

GS needs indentation done with spaces, MuPDF with tabs. Swapping back and forth is a pain.

I have 2 shortcuts setup to start VS2019. One entitled "VS 2019 (Spaces) starts it with:

 "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe" /ResetSettings "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\spaces.vssettings"

and the other entitled "VS 2019 (Tabs)" starts it with:

 "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe" /ResetSettings "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\tabs.vssettings"

Those files can be found here and here.

In theory the .editorconfig stuff should trigger automatically, but this seems unreliable to me.

-- Robin Watts - 2020-07-01

Comments

<--/commentPlugin-->
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 2014 Artifex Software Inc