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

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.

Related

Shortcuts don't work in Fortran (Visual Studio 2013)

I'm programming in Fortran90 within the environment Visual Studio 2013.
I want to format my code in a clever and easy way and I tried to use shortcuts (like Ctrl + I Matlab smart indent) but it didn't work out. It's actually really strange as I tried to use Ctrl+K, Ctrl+D but it is not working and I don't understand why...
Is there someone that can help?
Many thanks,
Antonio
Each language in Visual Studio has its own predefined shortcuts, and of course you can add your own key combinations. For Intel Fortran there is no "smart indent" but there is an indent option for which no shortcut is predefined. To see what's available, select some text and then do Edit > Advanced. For example, CTRL-K,CTRL-C will comment the selection.

Visual Studio code completion like ctrl+k in netbeans?

My question is there code completion for Visual studio like in Netbeans where you cycle the buffer with ctrl+k, when you type something?
There's now a nice extension called Simple Autocomplete which adds one command simpleAutocomplete.next that you can map to a shortcut of your choice.
No, there isn't a similar feature in Visual Studio.
The traditional Visual Studio autocomplete is using intellisense.
When you start typing, intellisense may bring up a drop down with suggestions. In that case you can tab to complete using the current suggestion or use the arrow keys to choose another.
Ctrl-Space (or Alt-Right arrow) will bring up this intellisense menu if it's not up.
I find it does a pretty good job overall.
Some extensions like Resharper or Visual Assist offer their own code completion or other similar features (like Suggestion List for Visual Assist).
I know it's been ages since I asked this question but I found the next best thing to do this. What I would suggest is to use VsVim extension and to use Vim's anyword completion; however, in order for this work, what must be resolved is the keyboard shortcuts that conflict:
Go to "Tools options" in Visual Studio.
Then go to VsVim category(alternatively you can search "VsVim" and
should bring the options) and click keyboard.
As far as I know vim deals with this type of completion with these keys
CTRL+P and CTRL+N so what we do is to let Visual Studio give up
these keybindings and let VsVim deal with it by Selecting from the drop
down of the keys(CTRL+P and CTRL+N) and let it be "Handled by VsVim".
I hope this has helped someone out.

Code editing in Visual Studio like it is in Aptana Studio

Is there any plugins to Visual Studio that enables you to have the wonderful type-style you get in Aptana Studio, ie:
Auto brace completion
Auto indentation of braces (and other characters) whenever 'enter' is pressed inside the braces, like so:
Before enter:
{*}
After enter:
{
*
}
Is it possible to make this work in Visual Studio (via plugin or otherwise)?
You can use, for instance, Resharper, http://www.jetbrains.com/resharper, which is a pay-for plugin for code style, code refactoring and formatting. Rather advanced.
There's also Visual Assist X, http://www.wholetomato.com/, as well as JustCode, http://www.telerik.com/products/justcode.aspx and a whole lot more. Several products available, most of them for money, most of them good. =)
Check Productivity Power Tools. It has plenty of nice stuff:
Auto Brace Completion
Quick Find
Enhanced Scrollbar
Searchable Add Reference Dialog
and others.

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