Excessive cursor reference highlighting VS Community - c++

so I have been using VS Community for a while now to code in c++ and somehow must have activated reference hightlighting. Now every time my cursor is inside a word it highlights every occurence in the entire file. This gets very confusing especially inside nested loops:
I tried looking for reference highlighting but could only find it in the C# section in the options.
I also tried changing the background color of the highlight to the background color of the plain text but this still draws the rectangle highlight box around it.
Is there no way to disable this cursor highlighting for c++? Basicly I only want the highlight to show when I actually hightlight stuff.

If you want to disable all cursor highlighting, you could set True in Tools->Options->Text Editor->C/C++->Advanced->References->Disable Reference Highlighting.
If you want to customize the cursor highlighting, here is a solution for reference.
This tip was proposed by Sairama Jamalapuram. Syntax coloring for user-defined keywords is used for C++ files only.
Here are the steps you need to take to enable syntax coloring for user-defined keywords. The steps are taken from the online help.
In the same directory as msdev.exe (for Visual Studio .Net search
for ...\Microsoft Visual Studio.NET\Common7\IDE\devenv.exe), use the
Text editor or Windows Notepad to create a text-only file named
usertype.dat.
Add your keywords to usertype.dat, one keyword per line. Note: The
usertype.dat file is read during initialization. It cannot be
renamed, nor can it be reloaded during an editing session. The
syntax coloring mechanism checks the usertype.dat file last. Thus,
all previously defined color settings take precedence over the
user-defined keywords.
Save the file as a text-only file, exit, and then restart Visual
Studio.
From the Tools menu, choose Options.
Select the Format tab.
In the Colors box, select User Defined Keywords.
Set the font, font size, foreground color, and background color to
your preferences.
Click OK.
Restart DevStudio.

Related

How can I change the line style of the indent guides?

Visual Studio 2017 comes with built-in support for indent guides:
Indent Guides ­– dotted, gray vertical lines act as landmarks in code to provide context within your frame of view. You may recognize these from the popular Productivity Power Tools.
Here's a screenshot demonstrating this:
I've been using Steve Dower's Indent Guides extension for years now, which supports changing the line style:
Is it possible to change the line style in VS 2017? I had a look in the Options but couldn't find anything relevant.
From everything I can see, there is unfortunately no way to do this, aside from using a different extension. If you use ctrl+Q to search (FYI, ctrl+Q is a great feature that many people don't notice), and search for "guide" you will see it only returns a single configuration option:
Text Editor -> General -> Show structure guide lines
So apparently, all you can do is turn it on or off and change the color of the lines. This can be done by going to Environment -> Fonts and Colors and looking for "Structure Guide Lines."

Is there a way to make a property for a vcxproj in the Property Pages not be bolded using Visual Studio 2013?

I know that when a property appears bold in Property Pages it indicates that it has been modified.
https://msdn.microsoft.com/en-us/library/675f1588.aspx
I have an API that we ship samples with, and I want all of the settings across all of them to be consistent and the same.
Unfortunately, some sample vcxprojs appear to have the right setting and are not bolded, while others somehow had a wrong setting and after changing it to the right one, it's obviously still bold.
I want all of the samples Property Pages to be consistent across all of the samples, even the bolding of text. I realize this is really just an OCD cosmetic type of an issue, and there is no technical problem behind it.
The .vcxproj file is just an XML file. I'm assuming that bold means that there is a setting specified in the file, even if it's the default.
So: edit the file in a normal text editor. Remove the setting, so that it uses the default value, and so that it no longer appears in bold in Visual Studio.

Vim isnt highlighting basic types in c/c++

I have recently started using vim and i see my syntax files are located in /usr/share/vim/vim74 (I'm on linux Mint) and my c.vim seems to make the basic things like int and double keywords however when I edit any c or c++ files none of the types are highlighted however some things like const are highlighted. I am not sure why this is happening. Can anyone help me out?
To check whether the syntax parsing works as expected, check (when editing a C / C++ file) with
:syntax list
that those keywords (like int) are defined. You'll also get a preview of the highlight coloring there. Alternatively, the colors are shown via
:highlight
To change those, you have to switch to another :colorscheme or edit / augment the current one.
For advanced troubleshooting, I recommend the SyntaxAttr.vim - Show syntax highlighting attributes of character under cursor plugin.

How to fix indentation in Systemverilog source

I am using systemverilog very often.
I am using UltraEdit as text editor. I use also VIM.
Sometimes I have to copy code from some other places and paste it into my code.
It may not be indented properly. It is a difficult task to indent it properly again.
Can anybody suggest any method or tool to do it easily?
Method
Visit EDA Playground
Paste your code into one of the editor windows
Select all text with CTRL-A
Reindent all text with SHIFT-TAB
Some backgroud
There is a Verilog mode for Code Mirror which supports SystemVerilog. CodeMirror is an in-browser text editor written in JavaScript which is used on a number of websites, including EDA Playground.
You could also paste and reindent in the example window here, or you could download it yourself and run it locally.
The verilog mode in Emacs supports indentation, so you can open your file in Emacs (from the command line, run emacs file-name.v, select all by pressing Ctrl+H, then reindent by pressing TAB and save with Ctrl+S.
UltraEdit has command ReIndent Selection at bottom of menu Format.
All lines of a selection of any type of text file can be re-indented (not reformatted, i.e. not inserting line breaks or removing line breaks) with this command as long as
the file is syntax highlighted based on a wordfile (*.uew) suitable for type of text file,
the syntax highlighting wordfile contains appropriate indent/unindent string definitions.
Therefore it is no problem to re-indent code after paste by selecting pasted block and use the command ReIndent Selection with a good syntax highlighting wordfile for SystemVerilog.
The syntax highlighting wordfile currently used for active file can be opened for editing or improvement by clicking on button Open left of language list box preselected according to used syntax highlighting for active file at Advanced - Setttings or Configuration - Editor Display - Syntax Highlighting.
The lines of interest in the wordfile regarding indent/unindent start with
/Indent Strings =
/Unindent Strings =
/Ignore Strings SOL =
More information about those three lines can be found
in help of UltraEdit on page Syntax Highlighting,
in online help on page about wordfiles, and
in user forum topic template for syntax highlighting language wordfile.
A user contributed syntax highlighting wordfile for SystemVerilog can be downloaded from wordfiles page.
Note: As command ReIndent Selection is a basic command for all languages, it is not as smart as tools written to re-indent or even reformat source files written for specific languages with true language intellisense like Artistic Style for C / C++ / C# and Java (also supported built-in by UE).

Visual Studio 2012 variable font color reverts to black from user-selected color

I am rather new to using Visual Studio and I am attempting to use a color scheme that is very similar to Sublime Text 2 as I enjoy the highlighting of this text editor.
I have downloaded the Sublime Text Theme from here.
When I import the theme, the colors change except for the variable names and the std namespace. Those revert to black for some inexplicable reason. I have tried installing other themes/color schemes and all have the aforementioned problem. I have attempted to go into options and change the font color for variables/namespaces to the desired color. It will revert to black as soon as I leave options.
I have opened and closed VS 2012, rebooted my computer, and attempted the use of other .cpp files with no avail.
I can make the colors display properly by typing a character on line one and moving the #include <iostream> down a line. You can see the difference in the attached photo. Any thoughts on what is causing this or how to fix the problem?
PS, I can't add the photo to my post as a new member, so here's the link to imgur.
I have found the solution to this problem.
For some strange reason the theme is not imported correctly.
You can manually change the color of the "c++ Local variables" and the "c++ namespace" color by going to options -> enviroment -> fonts and colors.
I had the same problem. The way I solved it was by changing the theme from light to dark.
Check this thread to see how:
https://stackoverflow.com/a/9596223/1426601