How can Visual Studio shortcut keys be used in Android Studio? - visual-studio

I am very familiar with the Visual Studio IDE, and am new to working with Android Studio. Is there a way to configure Android Studio so that the keyboard shortcuts that I'm used to from Visual Studio can be used in Android Studio?

Yes, this is possible.
For newer Android Studio Versions
This approach works on at least Android Studio v1.3 and later (per #Dazzibao's comment)
From the menu, select File | Settings. Select the Keymap option on the left, then from the Keymaps drop-down, select "Visual Studio". The defined shortcuts are then updated to Visual Studio settings.
Further customizations are able to be made, and applied. To export these settings, from the menu, choose File | Export Settings, and then select Key Maps, select a file, and save. These can be restored via File | Import Settings in the same way.
Note: Many of the shortcut keys that I was used to using C# are not set to be the same values using this method. Try the second approach (below) if not satisfied with Android Studio's "Visual Studio" key map assignments.
For older Android Studio Versions
The same approach has been documented here for the IntelliJ IDE, and also works for Android Studio. It involves downloading a .jar settings file intended for Resharper users, and importing it into Android Studio.
Navigate to: https://github.com/hhariri/Tidbits/blob/master/resharper.jar
Click "View Raw" to download the resharper.jar file
In Android Studio, import the settings: File -> Import Settings -> <fullPathTo>/resharper.jar
Keyboard shortcuts are now as they would be in Visual Studio. For example, from the Run menu, review the debug control flow shortcuts:

Related

Auto Complete Not Working In New Visual Studio 2022 For UNITY

So I have had visual studio 2019 and I used it with unity. I needed to delite it and reinstall it becouse of somthing and when I reinstalld it I installed new 2022 version. Ever since auto complete isn't working.
I have downloaded the "Game development with Unity" modifyer and selected Visual Studio Community 2022 in unity preferences but it still isn't working.
Does anyone have an idea what is wrong maby?
In the Unity Editor, select the Edit > Preferences menu. On the left, select the External Tools tab.
Select Browse... from the dropdown list.
Navigate to the C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE directory and select devenv.exe. Then select Open.
Close the Preferences dialog to complete the configuration process.
And make sure that you have Microsoft Visual Studio installed in package manager:
check this link: https://learn.microsoft.com/en-us/visualstudio/gamedev/unity/get-started/getting-started-with-visual-studio-tools-for-unity?pivots=windows
there are 2 fixes that I think will help you:
You need to enable IntelliSense by opening Tools -> Options -> Search for Intellisense, and head over to the C# Section and enable features like Show completion list after a character is typed.
For good practice, you should also install the C# packages for Visual Studio 2022.

Access settings in Visual Studio 2019

There is a lot about about changing setting in Visual Studio on stackoverflow. All of them start with go to 'File' -> 'Preferences' -> 'Settings'
Ref: Remove trailing spaces automatically or with a shortcut
But there is not 'Preferences' when I click on 'File' from top menu.
Could anyone give advise where is settings now/how to get access to them, please
Visual Studio 2019
Thanks
Visual Studio (one version of which is Visual Studio 2019) is a completely different application from Visual Studio Code. Information about one will not generally be applicable to the other.
For instance, Visual Studio Code has a "preferences" submenu in its file menu, whereas Visual Studio has most of its options available under "Tools->Options". (The preferences themselves will also be different, so this isn't just a matter of finding it in a different menu.)
Try Tools->Options, depending on what you wish to configure.

Visual Studio Color Format Redundant Code

I have Visual Studio installed in one PC in which text editor is format redundant code by color (as shown in the screen shot).
I want to activate this in visual studio copy installed on another PC.
That is not a Visual Studio feature, it is one of ReSharper Code Inspection features, hence you'll need to install ReSharper on the computer where you'd like to see this code coloring...
This is a visual studio (mine is 2015) feature and should be enabled. By default it should be enabled, but am not sure what version of visual studio you are using. You can enable it by going to Visual Studio -> Tools menu -> Options

Visual Studio debugger showing variables with memory address instead of value

I recently moved to a new PC, and my visual studio is now showing all variables in some sort of memory address mode. Normally I would just see the simple properties and values. I can't figure out how to turn this off and get the standard view.
Visual Studio Screenshot
Aw dude, so simple:
Close all instances of Visual Studio
Right-click on the Microsoft Visual Studio 2010 shortcut and go to its Properties
Go to the Compatibility tab and uncheck "Run this program in compatible mode for:" and say Apply
Now start Visual Studio and open the project. You should be able to debug it.

TypeScript rename variable

Anders Hejlsberg shows on channel9 that you can rename variables across multiple files with the Visual Studio TypeScript plugin. cf.: video introduction to TypeScript by Anders Hejlsberg at 50:08.
However, when I open the Refactoring menu, all items are deactivated, including Rename. I'm using the latest version of VS2012 Professional. Maybe this is related to ReSharper which is installed on my system. Can anybody could confirm this as a bug or is the Rename feature still in development?
Edit since I may not post this as an answer:
ReSharper overrides some original Visual Studio menu items.
There is a checkbox at RESHARPER -> Options -> Keyboard & Menus -> Hide overriden Visual Studio menu items.
Check this and the original Refactoring menu shows up again. There is the Rename feature which is working just fine.
There are two reasons you may not be able to refactor the name in Visual Studio.
If you are running your application in debug mode, many editing features are not available
If you have a Visual Studio extension, such as Resharper, it may have overridden the Visual Studio feature in the menu, or shortcut keys. For rename, the Visual Studio shortcut is simply F2, so it shouldn't clash with the Resharper key-combination - but Resharper may still override the context menu.
ReSharper (7.1.1) doesn't have built-in rename support for TypeScript. If you have ReSharper installed it is probably overriding (and hiding) Visual Studio's native rename -- this is the default functionality.
To show and enable Visual Studio's rename you need to uncheck the following option:
RESHARPER -> Options -> Keyboard & Menus -> Hide overriden Visual
Studio menu items
(Per the comments to this post, you can vote for this feature to be added to ReSharper at the following link: http://youtrack.jetbrains.com/issue/RSRP-330454)

Resources