Is there a way in Android Studio to use Ctrl+tab to navigate to recently used editor? - android-studio

Is there a way in Android Studio to use Ctrl+tab to navigate to recently used editor?

Android Studio has two types of switching methods, as can be seen on the keymap settings:
"Recent Editors" - shows a list of recent editors but you need to leave the ctrl key and click up/down keys then another click to select the relevant editor.
"Switcher" - shows a quick list of recent editors. Setting Ctrl+tab to this will behave like many of the other editors in the market: Notepad++, Visual Studio, Eclipse ADT, etc...

You can use Ctrl+E to list last opened or edited files, use arrow key to move up and down.

Ctrl + tab is already doing that! it shows the switcher having the most recently used editor highlighted, after releasing Ctrl key it will switch to the editor, if you keep holding the Ctrl then there are 2 ways to navigate through the switcher, either by Tab, or by up and down arrows with Enter.
Another way is Navigate-> Back/Forward which will move cursor between edit locations in same file and move along to other files, the default key mapping for those are (Alt +Ctrl + Left)/(Alt +Ctrl +Right), which conflicts with windows mapping, Personally I am using Eclipse key mapping, so they are (Alt + left)/(Alt + right).
Don't forget that you can change any key mapping or add an extra key mapping from File->Settings->Keymap

Related

Keyboard shortcut for moving tabs in SublimeText3

Every time I open a new tab in SublimeText I have to take my hands off the keyboard and use the mouse to move the newly opened tab to the desired position among the existing tabs...
Surely there must be a keyboard shortcut for moving SublimeText Tabs left and/or right?
Please say yes...
Not by default unfortunately, but there are two awesome things about Sublime to be aware of:
This plugin https://github.com/SublimeText/MoveTab will let you move tabs with CTRL + Shift + page up/down
You can go to any tab by pressing ctrl+p and typing the name of the tab, so if your tabs are disorganized, you don't have to visually search for them or organize them as long as you know the name of the file you want (or a substring of it if it's unique enough)
It seems as if there are no shortcuts to do this.
You can see all actions and their shortcuts in the command palette (Ctrl+p on Windows). There is no such action as Move this tab to the left.
The good news, however, is that there is a plugin that does exactly this:
https://github.com/SublimeText/MoveTab
You can install it using Package Control.

Visual Basic 2013 - Pressing ALT gets me out of code

I just installed my Visual Basic and this is a problem I couldnt find an answer to. Everytime I press ALT it gets me out of code, and because I use SHIFT+ALT to change keyboards a lot while writing code, this is really disturbing to have to click in code again to be able to write.
Any ideas ?
Are you referring to the normal Windows way of accessing the menu via keyboard? This has nothing to do with Visual Studio; it will work similarly in almost any Windows application.
E.g. pressing Alt+F will open the File Menu etc. Just pressing Alt will highlight the menu (you should see the shortcut letters underlined for each item) and pressing a letter key will then open the menu. Instead, press Alt again to return to what you were doing before.

How to configure IntelliJ (also Android Studio) redo shortcut to CTRL+Y instead of CTRL+SHIFT+Z?

The default IntelliJ / Android Studio "Redo" action shortcut is CTRL+Shift+Z and this is a common problem for Windows users.
A bigger problem is CTRL+Y is mapped to the "Delete line" action - and this causes the undo stack to be lost.
To solve this issue, how can the "Redo" shortcut be changed to CTRL+Y in IntelliJ?
Open Settings (press CTRL+ALT+S)
Click Keymap on the left list.
There is a combobox that contains keymaps. Select one of them (default means IntelliJ of course. We can't change any of pre-defined keymap however we can copy, edit and then use the edited one. So) we should copy "default" to change only redo mapping.
Give a new name to your copied keymap.
Right click on:
Main Menu -> Edit -> Redo to click "Add Keyboard Shortcut"
Press CTRL+Y
Click OK
Click "Remove" to "the shortcut is already assigned to other actions. Do you want to remove other assignments?"
If you want to use any "remove line" shortcut also, then go to delete line shortcut and give to it any other shortcut (like 5th step)
Click OK to close settings window.
Change the keymap setting to the Visual Studio, Eclipse, or NetBeans preset.
The settings window can be found under File > Settings. CTRL+ALT+S should work if the shortcut hasn't been changed. In the settings window you should find Keymap under the Appearance & Behavior settings list.
You can configure each editor command to a key combo that you like (as #ismail yavuz mentioned) such as for Redo to CTRL+Y or you can just change the Keymap setting to an editor that you are used to. This might be best if you are in the process of switching to IntelliJ as it is probably the path of least resistance. The default settings for the Visual Studio, Eclipse, and NetBeans keymaps all map Redo to CTRL+Y.
The Principle of least astonishment is strangely violated for Windows users but at least shortcuts is customizable. Because of this command being so contrary to the Windows experience I decided it wasn't worth learning the IntelliJ keyboard when anywhere you're working at you need to, you can quickly change. There are almost no drawbacks to not learning the IntelliJ. Remember that in the keymap menu you can search for a command in the search box or click on the magnifying glass on the right to search by key combo.
Of course neither answer is wrong. Chose your preference.

Visual Studio Hotkey - Go up one folder

In Windows Explorer, one can press Alt + Up Arrow to "Go up one folder"
When developing in Visual Studio, all too often I want to find a relative path from a file to some location higher in the hierarchy. Unfortunately, Alt + Up doesn't work in Visual Studio to travel up the folder hierarchy. Is there a different hotkey or a way to set one to do this inside the IDE?
I'm not sure if there is a built in shortcut, but you can create your own: Go to Tools | Options | Environment | Keyboard and look for the right command for going up to the parent directory. Then click the Press Shortcut Keys box and press your new shortcut.
Old post but I answer anyways.
One layer down (into folder): Enter
One layer up: Backspace
Select file: Arrow Keys
Select multiple files: Arrow Keys + Shift / Ctrl
Delete file: Delete
Unselect files: Esc

Can resharper navigate to a method?

I know how to navigate to a file or a class, but can I navigate to a class's method?
Oh and say I am viewing a different class's file
With respect to my correctly configured keybindings, all of the previous answers seem outdated/invalid to me.
I say:
Hit Alt + \ to list all file members.
Then find your method in the list and navigate to it.
If you use "Resharper 2.x or IntelliJ IDEA" keyboard scheme:
Ctrl + Shift + Alt + N -> navigate to symbol
In Visual Studio Scheme:
Shift + Alt + T
For future reference and other options check https://www.jetbrains.com/resharper/features/navigation_search.html
If you are using Resharper IDEA Scheme, do ctrl + F12 and you can enter a member name, fastest way to navigate to a method, property etc on that file
Ctrl + Click (or Right Click > Go To Declaration). Works on Methods, Fields, Properties, Types, and just about everything else.
With VS2015 and ReSharper 10 press Ctrl + T. This will search for types, symbols and files. It will search through everything in your solution.
Update: works the same in VS2017 and ReSharper 2017.2.
You can also press Ctrl + T followed by / mm to search for just methods.
Another tip for the current file is to use the File Structure window - can also drag and drop members around from the window.
I have used Dpack (f/oss) for years and it can go to methods and/or properties by pressing a shortcut and then start typing. For those who get Resharper's ctrl-T working it is like that one but within the file.
Dpack provides the same functionality for finding files and open files. The former is a better version of Visual Studio 2015's ctrl-;.
(I have done some remapping of keys too but in my experience something (resharper?) overwrites my changes from time to time.)
(Also with VS2015 and R#9.2 I think Dpack does a better job at this.)

Resources