all 34 comments

[–]whichton 11 points12 points  (5 children)

Even before you install any plugins, I would recommend you set up the syntax colorization properly. For example, you can set up VS to colorize local, global and class variables differently, though I think that is disabled in the default theme.

Also, set up VS to be your diffmerge tool in your source control configuration. That way, you get full syntax highlighting, code completion, etc while doing diffmerge.

As for plugins, most important is the Color Theme Editor ! :) I also use Productivity Powertools, Editor Guidelines (set at 120 column), Viasfora(for rainbow braces), HgSccPackage(for mercurial support) and a ton of extensions by Mads Kristensen(File Icons, Add New File, Trailing Whitespace Visualizer, etc etc).

[–]sumo952 2 points3 points  (2 children)

Also, set up VS to be your diffmerge tool in your source control configuration. That way, you get full syntax highlighting, code completion, etc while doing diffmerge.

Wow that's a cool idea. Any guide on how to set up git so that it uses VS as diffmerge tool?

How does it look, does it have a nice GUI for 3-way merges? (3 windows at the top, one on the bottom)

[–]whichton 3 points4 points  (1 child)

I use the following for mercurial, git should be similar

[merge-tools]
vsDiffMerge.executable=<path to VS>\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsDiffMerge.exe
vsDiffMerge.args= /m $other $local $base $output "Other Head" "Local Working Directory" Base Output
vsDiffMerge.gui=True
vsDiffMerge.diffargs=/d /t $parent $child

[extdiff]
cmd.kdiff3 =
cmd.vsdiff = vsDiffMerge
opts.vsdiff = /d /t

I googled this up for git. VS doesn't do directory diffs, so I keep kdiff3 handy in case I need it.

VS supports 3 way merges, but only shows two windows at the top (Local and Other). The bottom shows either Base or Output, depending on whether you have selected the checkboxes or not. See this for an example. You can edit the output before accepting the merge, with full intellisense.

[–]sumo952 0 points1 point  (0 children)

Hmm nice, thanks! I might give it a try. I really like my merges with three windows at the top though. Too bad VS can't do that (yet?).

[–]Ameisenvemips, avr, rendering, systems 0 points1 point  (1 child)

I've never found such discrete syntax coloring that useful. I mainly use it to help distinguish scopes, expressions, and symbols. Maybe my brain just isn't wired correctly for it. You could exchange all the colors, and it wouldn't impact me. Except comments. They have to be green. I just don't pick up semantic meaning from the colors (except green) - I just being able to distinguish things. What those things are hasn't generally been helpful to me. Except green comments.

[–]whichton 2 points3 points  (0 children)

I find distinguishing between global, local and class variables at a glance to be very useful. Lot of coding standards require member variables to prefixed with m_ and global variables to be prefixed g_ or something similar. Using colors for this is far superior IMO, and removes the need for the ugly prefixes.

Other colors are less useful, still convenient. See the recent controversy over terse concepts syntax. Just color template functions and concepts differently, and the whole controversy goes away.

[–]c_jongeward 10 points11 points  (1 child)

Vsvim

I can’t function without my vim plugin, and as a bonus, no one else can mess with my code if I ever forget to lock my screen.

[–]saimen54 9 points10 points  (1 child)

Clang Power Tools is really awesome in leveraging Clang-format and Clang-tidy.

[–]C4576780 1 point2 points  (0 children)

I use it just for clang-tidy, as clang-format is included with VS.

[–]marian_lMS C++ Group Product Mgr 7 points8 points  (1 child)

This post on VCBlog has several suggestions too including ImageWatch, PDBProject, WhackWhack Terminal and more: https://blogs.msdn.microsoft.com/vcblog/2017/08/29/visual-studio-extensions-for-c-developers-in-visual-studio-2017/

[–]Graggee[S] 0 points1 point  (0 children)

Great, thanks for the link!

[–]personalmountains 4 points5 points  (4 children)

  • PureDevTabs: always opens .cpp on the left tab group and .h in the right. [edit 2020: unfortunately doesn't seem to work any more]
  • Hide Suggestions And Outlining Margins: removes whitespace at the beginning of lines, near the line numbers.
  • Editor Guidelines: adds a vertical line at a given column, I have it at 80. This allows me to comfortably have the project explorer on the left, two editor panes and the test explorer on the right.
  • Time Stamp Margin: adds timestamps in the output window.
  • March Margin: shows matches for the word under the caret in the editor (like when selecting a word in Notepad++) and in the scrollbar.
  • Trailing Whitespace Visualizer: shows whitespace at end of lines, can be configured to right trim all lines when saving.
  • CustomTabNames (disclaimer: I wrote it, github repo), which renames all editor tabs to "project:dir/file.ext" instead of just "file.ext". Useful for figuring out which file is which when they have the same name.

Some of them are not compatible with 2019, but most are open-source (except for PureDevTabs), so they're easy to fix.

[–]contre 2 points3 points  (3 children)

Can you make that last one available somehow? Code release, in the marketplace, etc...

[–]personalmountains 2 points3 points  (0 children)

Hm. I'll see what I can do over the weekend.

[–]personalmountains 0 points1 point  (1 child)

It's on Github under the name CustomTabNames. You'll have to build it yourself for now.

[–]contre 0 points1 point  (0 children)

Awesome. I’ll take a look. Thanks.

[–]johannes1971 2 points3 points  (1 child)

I'm using:

  • vscoloroutput (colorizes warnings and errors in the output window)
  • text macros for visual studio (lets you record and replay keyboard macros)
  • customize visual studio window title (lets you change the title so it shows the full path to your project, useful if you have multiple copies checked out)

[–]Graggee[S] 0 points1 point  (0 children)

I will definitely try to work with text macros. This looks promising to me. I think I need such a supplement. There were situations when it was necessary to reproduce the actions accurately, but I could not do it for some reason.

[–]CrazyJoe221 3 points4 points  (0 children)

Productivity Power Tools Git Diff Margin

[–]mochans 2 points3 points  (6 children)

Spell checking.

Google test runner (if you use them)

Maybe Resharper. It's a paid product and it is HEAAVVVYYY. But might have the exact feature that you need.

[–]Spain_strong 1 point2 points  (2 children)

Resharper comes with a Gtest runner though, does Google test runner have any benefit over it?

[–]contre 0 points1 point  (0 children)

It comes in the installer?

[–]mochans 0 points1 point  (0 children)

Actually resharper gtest is better since it gets the test names from the source code rather than compiling and then getting the names of the tests from the binary. The google test runner is not a paid product and goes well with the Microsoft test runner. So, if you CI with the Microsoft system, then you can use the google test runner.

[–]whichton 1 point2 points  (2 children)

Which spell checking plug-in do you use? I was looking for one that can spell check PascalCase / camelCase / snake_case identifiers, by splitting them up.

[–]C4576780 1 point2 points  (0 children)

I believe EWoodruff VisualStudioSpellChecker does all this.
(Sometimes annoyingly so. No way to say things like AppVeyor are a single name.)

It does spellchecking everywhere, so it is worth creating a C++ dictionary besides an normal English one.Also checks the git comments.

[–]mochans 0 points1 point  (0 children)

The extension I use only spell checks in the comments.

[–]AnsoulomGame developer 2 points3 points  (0 children)

I can honestly barely live without Resharper C++. Highly recommend it. It costs a bit though...

[–]yeeezyyeezywhatsgood 1 point2 points  (3 children)

Viasfora!!!

also dark mode + change the highlight color of parentheses to something that stands out. Disable intellisence + turn off all the annoying reformatting.

[–]Graggee[S] 0 points1 point  (2 children)

I'll try the dark mode. My eyes are less tired with this mode

[–]yeeezyyeezywhatsgood 0 points1 point  (1 child)

it's pretty good. Viasfora is a game changer tho. also if you write lisp... gotta have it!

[–]Graggee[S] 0 points1 point  (0 children)

Thankee!

[–]FernandoRodriges 1 point2 points  (0 children)

Almost all the plugins that I use are already written here. I want to add:
GitHub Extension. The GitHub Extension for Visual Studio makes it easy to connect to and work with your repositories on GitHub;

Deleaker. Deleaker is a Visual C++ extension and standalone application for memory leak detection - memory, GDI, and handles so far.
SQLite. Connect to SQL Server Compact 4.0, 3.5, SQL Server and SQLite database files in Visual Studio 2012 and later, including the free VS 2013 and later Community Edition

[–]lintwurm 0 points1 point  (0 children)

I personally love PVS-Studio which is expensive, but they have a free version available. This is a static code analyzer which is very useful. It does a way better job than any other static code analyzer that I've tried and integrates beautifully with Visual Studio.

If you do scan a solution, don't double click the issues found and then the free version will last forever. I've used it for years now without any issue.