Incremental search/replace in Visual Studio - visual-studio

So the other day a Sublime lover showed me how to do incremental search/replace in sublime and asked if I could do that in Visual Studio. After googling I found that Visual Studio does support Incremental Search through Ctrl + I, but there was no obvious way of doing "Replace All". Googling further didn't give any promising results. I did however find that this would require support for multiple carets, which I'm not sure is available or not in VS. Does anyone know how to do that?
Some possible alternates could be the Rename facility and Find/Replace etc, but none of them is as swift as Incremental Search. I have tried a few add-ins too, but none of them does what the linked video shows.

Related

VS Intellisense: removing some autocomplete words

I like that the intellisense in VS corrects me when I make mistakes, but sometimes I don't make any mistakes and it corrects me still. I'm coding for Unity and I cannot write "var" without it being changed to "SerializePrivateVariables" as soon as I press space.
Is there a way to remove some of the autocomplete triggers in the intellisense? I couldn't find how to do so.
You cannot disable specific words from autocompletion in C# in Visual Studio 2015 as far as I know.
In your case, however, you can enable keywords in completion lists. Then the intellisense should understand that var is a proper C# and not replace it.
You can do this by going to TOOLS > Options > Text Editor > C# > Intellisense and checking the "Place keywords in completion lists" option.
There is a bit more options in VS2017 and VS2013 (and older), but none of them have the exact feature you have in mind.

IntelliJ and Visual Studio select and rename a variable in multiple places by a shortcut behavior as 'Ctrl+D' in Sublime?

Because of the lack Intellisense in Sublime, I prefer to using Visual Studio to code C# and Pycharm to Python.
ctrl + d in Sublime can select mutiple same word in text. So I can alter the selections on same time. It is convenient to alter the name of same variable in a function. How can I do that in my other editors?
The Ctrl-D multiple selection tool is one of its greatest features of Sublime Text 2 and is sorely lacking in other editors and IDEs.
Visual Studio doesn't have it built-in but there's a MultiEditing plug-in for it.
IntelliJ, which PyCharm is based on, doesn't have it either but it's apparently being planned for a release that should be out soon. See this blog comment (and the link in it) for more.
Meanwhile, you can use the rename refactoring tool in Resharper (for Visual Studio) or in PyCharm. It's not the same as multiple selections but is very useful functionality in its own right.
A nother IDE that does support it is Webstorme - alt+j. you can read the stackOverflow discussion about it here : How can I select next occurrence in IDEA editors
I just tested it on Webstorme10, and it works perfectly, just like in Sublime.
Try ctrl + h. It is the standard shortcut in many editors for replacing text.

Alternative keyboard shortcuts to Resharper's "Open by filename" or "Open by typename"

Resharper has some commands I just can't live without (keybindings are given for the Visual Studio template):
Open by filename (Ctrl+Shift+T)
Locate in solution explorer (alt-shift-T, useful only when solution explorer is configured not to track the current file already)
Does visual studio have alternatives to these that don't require Resharper? I know VS2010 adds the "Edit.NavigateTo" command (Ctrl+,) but it is slow and shows every useless symbol that might be what you want (too noisy).
Is anything similar offered by other perhaps free addons?
You might want to try the Solution Navigator feature that is bundled with the free Visual Studio Productivity Power Tools extension. It appears to have more powerful support for searching for files and symbols all combined within the Solution Explorer.

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.

Keyword highlighting on selection in Visual Studio 2008

A little while ago I managed to get Visual Studio 2008 (C++) into a state where, if I would select a keyword (or any symbol for that matter), by either double clicking on it or highlighting it, all other instances of that symbol within the current file would become highlighted too.
This was a really useful feature.
Since then it's gone away, and I don't know how to get it back.
Please help.
#Sander - that'll be it. Thanks!
I think you've installed RockScroll. It also lights them up in the graphical scrollbar (its main feature)
I use MetalScroll, it's like RockScroll only better; it doesn't interfere with Resharper (a VS must-have) and you can set it up to only highlight if you hold down 'alt' when you double-click.
There is something called "WordLight" by Mikhail Nasyrov.
An add-in for Visual Studio 2008 that highlights all occurrences of a selected text.
It searches and highlights substrings that are currently selected in a text editor.
Can be found at below link
WordLight
https://marketplace.visualstudio.com/items?itemName=MikhailNasyrov.WordLight

Resources