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
Related
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
I find myself with many files open in the editor (in separated tabs), and sometimes I want to find specific file in the project explorer.
Does there is any shortcut to reveal the file in the project window ?
EDIT to do the question more clear I add a picture:
There isn't a single key combo that can do this, as far as I know, but you can go with
On Windows
Alt + F1 followed by either 1 or enter
On Linux (using Gnome)
Alt + Shift + 1 followed by either 1 or enter
On Mac OS
Option + F1 followed by either 1 or enter
Android Studio is based on intelliJ, which has a function to open the current file or symbol in various views. The default key combo (in Windows) is ALT + F1.
This offers to open the current file or symbol in a bunch of different views, but the first option (with shortcut key 1) is the project view.
It's the same as choosing the Navigate > Select in... menu option, followed by option 1.
Note that you can customise the key mappings, or select other defaults instead of the default intelliJ configuration, so this might not be the case with your set up.
You can check the key mapping in settings > Key map and search for Select In... or, more simply, click the navigate menu and look at the Select In... option to see the shortcut key displayed in the drop down.
You can go to Navigate -> Select In, which has default shortcut Option+F1 on macOS.
For Xcode, the shortcut is Cmd+Shift+J. If you want the same, follow these steps
Go to Android Studio -> Preferences -> Keymap
Search for Select In in Navigate
Right click and select Add Keyboard Shortcut
Press Cmd+Shift+J
Is there any shortcut for Add Watch in android studio?
While debug windows is focused I can use Alt + Insert, but this is not working in code editor.
There is no direct shortcut for Add to Watches but you can define your own.
Go to File -> Settings -> Keymap
Expand 'Other' folder at last and find 'Add to Watches'.
Double Click / Right Click on it and select 'Add Keyboard Shortcut'.
Enter your keys and Done!
Did you try to assign a combination to your liking under preferences -> keymap -> search for "watches"?
Do you know how to check the location of current editing file in the project tree panel (the very left panel of the Android Studio), except manually. (The worst case is that all the folders there are collapsed)
The Navigate->Class shortcut can show me the src file in edit panel (central panel) quickly. Then I want to know the src file's logic location in project tree (left panel), so that I can add some new files in the same package quickly. (e.g. right-click the package and add new Class).
Currently, I have to expand the project tree and find it folder by folder.
Actually, in Xcode there is such a shortcut named "Reveal in Project Navigate"
What a convenient way it is.
I wonder whether this is also supported in Android studio.
Thanks
You can use the Scroll from Source button in the Project Toolbar in the left of Android Studio.
Another solution is Alt+F1+1. You can also read Locate current file in IntelliJ for more answers.
Just enable the following option!
In Android Studio 4 it is now Always Select Opened File under the Settings menu in the project view.
For automatic scrolling, you can do following:
You need to ensure Autoscroll to Source and Autoscroll from source is enabled.
Whenever you change the file the Project tree will be highlighted according.
I have observed some slowness and lag if project size is big(several modules or huge code base) and you use short cut Ctrl + N to navigate to a class.
So the alternative would be to either to click following icon:
OR
Use keyboard shortcut:
Alt + F1 + 1 or Alt + F1 + Enter
You can add shortcut (keymap) to "reveal current editing file in project explorer" command.
Press Ctrl + Alt + S, for Windows user, to open Settings
Select Keymap on the sidebar
Find the command using search box, type this into it: select in project view
Right click the result then select Add Keyboard Shortcut
Type any keyboard combination you want, for example, me prefer shortcut Ctrl + K to reveal current editing file on project explorer
Click OK button. It will prompt you to remove keyboard shortcut you typed from existing command, so just click Remove button.
I'm new to android development. I used to code in Sublime Text 3. One of first thing I do to make android development feels more enjoyable is binding all shortcut I used in Sublime Text 3 to Android Studio. Now, it feels like home :)
For Mac users: Option+fn+F1, then Enter.
Android Studio 3.6.3 (April 2020)
Go to Preferences > Keymap & search for "Select in Project View" and assign your keyboard shortcut.
Under options menu, select Auto scroll from Source
Navigate -> Select In.. -> Project View -> Project
open pref -> Keymap, then search 'select file in project view', not 'select opened file'.
In Visual Studio 2012 the find and replace window has Docking alignment to the top right side, how to release it?
The "quick find" window isn't docked in the usual sense. Press Esc to dismiss it and also make the yellow-orange search result highlighting go away.
Alternatively, click the X in the top right of the mini window.
Edit.Find = docked Find window
Edit.Replace = docked Replace window
Edit.FindinFiles = undocked Find window
Edit.ReplaceinFiles = undocked Replace window
so for undocked windows you can press Ctrl + Shift + F or Ctrl + Shift + H
or alternatively change shortcuts in Options > Environment > Keyboard to reach desired windows easier.
This is not possible unfortunately, which really drives me nuts when trying to find something in a minified file (single line) since the find window commonly blocks the found result.
Last post I could find about it:
https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/3636907-let-me-undock-the-find-and-replace
The best solution I can find is copy and past file into notepad and find there (for my needs).
In Visual Studio 2012 all docked windows can be released as follows;
Docked Window's Header right click menu (or click Window Position Icon what located the far right of the header)> Float menu
If the usual things, as already suggested, won't work, here are two other ideas I have found to work with oddities in Visual Studio.
Disable all plugins and try again (had a weird case of VS crashing on Ctrl+S and it was a faulty plugin)
Try a repair on the install, could have some faulty files.