how to disable word automatic highlight in visual studio 2019? - visual-studio

In visual studio 2019, if you click a word, it will highlight all its occurrences.
But if click some blank place, it will de-highlight all.
I only want to highlight the words when double-clicking it, and de-highlight the words if I double click it again.

It differs for each programming language. For C/C++ it's:
Tools/Text Editor/ C/C++ /Advanced/Disable Reference Highlighting (in
References section)

"MultiWordHighlight" is a great extension which can replace visual studio's internal feature.

Related

Visual Studio surround with current line if nothing selected

I'm using the Surround With feature in Visual Studio with some custom code snippets. Is there a way to configure visual studio (or a custom surround snippet) to treat the entire line like it is selected, if there is currently no selection?
The same functionality is provided when you do a keyboard shortcut such as Ctrl+C, Ctrl+V etc. If you have no selected text, it performs the action on the entire line.
If someone still wants to answer this as far as doing this with Visual Studio's native functions, they can - However it was pointed out to me in a comment that resharper does this automatically. Which is something I did not realize. Seem's I'll be moving all my VisualStudio surround snippets over to Resharper Surround templates!

How to include special characters when selecting text in the Visual Studio editor

I've recently started following the recommendation to use $ as the first character in the name of all jQuery variables, so it's easy to differentiate them from normal JavaScript variables.
Unfortunately the JS editor in Visual Studio 2010 doesn't pick up the $ when I double-click to select a word, or when searching for "whole word".
I know some text editors (Textpad, for example) allow you to tweak which characters are included in words. Is there any way to control this in Visual Studio?
This doesn't really answer the question, but the problem has gone away as the $ symbol is included automatically in VS 2012 and beyond.

Visual Studio addin; to highlight all words which match selected word?

While using NotePad++, and select a certain word, it automatically highlights all matched words?
Does anyone know if there is a Visual Studio addin that can do this? or are there any hidden environment setting that can do this?
Check following addins
Productivity Power Tools addin
The background colour of the highlight in Productivity Power Tools is found under Tools->Options->Productivity Power Tools->Enhanced Scroll Bar->Words Matching The Caret Location Color In The Editor.
or
Use Highlight selected word addin.
I believe Visual Assist can do that. This can be switched on in Settings -> Refactoring -> Automatically highlight references to symbol under cursor.
This is something that is automatically done by VS 2010 though if you are using an older version of VS you can get that functionality with third-party addins. For example I used to use an add-in called RockScroll that could highlight usages in a source file (By double clicking on the word) http://www.hanselman.com/blog/IntroducingRockScroll.aspx.
Also ReSharper has that functionality built into it with Cntl + Shft + F7

Highlight all occurrences of a selected object with ReSharper

I was used to use RockScroll (or MetalScroll), but when I started to use ReSharper my RockScroll start to show some bugs. Well, this is scope to another discussion https://stackoverflow.com/questions/1089493/is-rockscroll-compatible-with-resharper.
But my problem is related, because now without MetalScroll I can't highlight all occurrences, what I consider very useful in many situations.
Someone have another plugin for VS2010 or for ReSharper that do the same or better?
I think you are looking for "Highlight usages in file" This can be access via Shift+Alt+F11 or Ctrl+Shift+F7 depending if you are using VS key bindings or InteliJ bindings. Use either Ctrl+Alt+Up/Down or Ctrl+Alt+PageUp/PageDown to go to next and previous highlights.
You can also use the Ctrl+Alt+G combo to bring up a menu of what to jump to. This can be used to move the cursor to the next occurrence.
You should try Productivity Power Tools for Visual Studio 2010. There are other versions, at least one for Visual Studio 2013 and another one for Visual Studio 2015.
It plays nicely with ReSharper and has this selected text matches highlighting both in the editor and the scrollbars among many other features.
Try the visual studio extension RockMargin which highlight the occurrences on double click (like most IDEs). Works fine with VS 2015 and ReSharper.

Highlight all references to X?

The Eclipse IDE has a neat little feature that I really miss in Visual Studio.
If I place the cursor on a variable or method name, the IDE will automatically highlight all references to it in the current document within the relevant scope.
I can't seem to find an option to turn on similar behaviour in VS2008 or Resharper 4. I know VS has a Find Usages function, but I'd like to do it automatically on the fly.
Does anyone know of a free addin which will add this functionality?
If you're using ReSharper, you can highlight the usages in the file with Shift-Alt-F11. Place your cursor on the variable you want to find usages of, and press the Shift-Alt-F11 combination.
There is an add-in for Visual Studio that will do something similar called RockScroll.
When you double click on something, it will highlight all occurrences of the item you double clicked. It also changes the vertical scrollbar to a "syntax highlighted thumbnail view" showing an overview of where the item occurs in the file.
I know you mentioned ReSharper, but CodeRush has a nice references window that you can dock and let it search for things on-the-fly or on demand. As a bonus, you can select each usage and it will show you the context surrounding the usage. It also works for methods.
I mentioned CodeRush since they have an express edition, which looks like it includes that feature, but I haven't tried that edition.
Visual Studio 2010 has sorta implemented this, but the feature is somewhat lacking. There is a non-configurable delay between placing the cursor and highlighting.
The RockScroll Addin is not available for Visual Studio 2010 and above.
As a replacement, the free "Highlight all occurrences of selected word" plugin will highlight all occurences of the selected string after a doubleclick. There is no delay as with the native vs2010 highlighter.
It is string-based, which means it works inside comments and string literals.
Microsoft published a tool that sort of does what you want.
Some of my favourite features:
Enhanced Scrollbar
Auto Brace Completion
Ctrl + Click Go To Definition
Open Containing Folder
and the list goes on.
For Visual Studio 2010 and for Visual Studio 2012

Resources