Open path of a file in project explorer - android-studio

Often I have the case that I have a file opened in the tabs like item_category.xml here:
The project explorer still shows something else. Any way to open the path to item_category.xml in the project explorer? I already checked the right-click menu of item_category.xml, but couldn't find a matching option.

Use that symbol in the project explorer (shortcut: Alt+F1, 1):
More information on the feature: Locate a file in the Project tool window.

If you don't want to use mouse but keyboard shortcut
First option could be assigning a shortcut to Select in Project View may do the trick. It is located under Keymap/Other.
Second option could be to install Scroll From Source plugin for this. The details are here
Set the keyboard shortcut to the function of "Scroll From Source" in Project Panel. You can set the special shortcut by yourself to all OS(Window/Linux/Mac)
Default shortcut is Command + Control + S for Mac.

Related

Switch to tab by file name in text editor

I have multiple files open in different tabs in sublime text 3. Is there a way to switch to a tab by the name of the file that's open in it? If there's a different text editor that supports this, it'll be equally helpful. Thank you!
If you open the Goto Anything popup menu by hitting CtrlP, the currently opened files will be listed at the top.
You can also select file tabs at different positions in the tab bar by using Alt#, where # is the file's position - Alt1 for the first file on the left, Alt2 for the second from left, and so on. You can use CtrlPgUp/CtrlPgDn to navigate through the tabs in order, and CtrlTab/CtrlShiftTab to navigate through the stack of recently focused tabs.
All of these options are available under the Goto → Switch File menu. Some of the keyboard shortcuts may be different on macOS.
CudaText editor (free) has the command "Find tab by title" in the plugin CudaExt. Command shows menu with the filter field. To install the plugin: "Plugins / Addon manager / Install".

shortcut in Android Studio to locate the current editing src file

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'.

Hotkey to open TFS Source Control Explorer in Visual Studio 2012?

Currently I have to open Team Explorer and click on Source Control Explorer as below snapshot.
I do this very often and need a hotkey for that.
What is it then?
Try with below step:
Go to Options of Tools menu
Select the Keyboard from Environment
Select View.TfsSourceControlExplorer from Show commands containing:. You can type View.TFS in the textbox to filter the list.
Enter your hotkey in Press shorcut keys => click on Assign
Hope it helps!
According to a comment that I found in the site that #Adarsh mentioned, Alt+V,E,S will open the Source Control Explorer. It's a couple extra keystrokes but it works for me!
You can use Ctrl+0,P to open the Pending Changes Window.
You can find all the shortcuts for team Explorer on this blog: http://blogs.msdn.com/b/buckh/archive/2012/06/06/team-explorer-2012-keyboard-shortcuts.aspx
Update:
In Visual Studio 2013 Ctrl+0,P doesn't seem to work to open Pending Changes, but you can use Alt-V,E,H or configure a custom shortcut in the menu Tools/Options/Environment/Keyboard.
Just wanted to share another alternative I learned. One could set an alias in VS Command Window and launch it from there.
alias sce View.TfsSourceControlExplorer
note- 'sce' is an alias of your choice. I generally abbreviate. Obvious but having a pattern will be helpful if you have many of these.
Steps:
Open command window (ctrl+alt+A)
Set the alias (the statement shown
above)
Next time you need to launch the Source Control Explorer,
switch/launch command window and type your alias name. 'sce' in the
above example.
Alt+V,E,S works for me even in VS 2015
In case you like to see more shortcuts, please visit this site
http://visualstudioshortcuts.com
IN VS 2015
Toolbar=>Team=> Manage Connections =>(window like solution explorer will open on right side) Team Explorer- Connect=> Beneath the home symbol ==> Click "Connect"=>Click "Source Control Explorer"

VS2012 : where is custom toolbar command SyncWithActiveDocument?

In Visual Studio 2012, you can create customized toolbars and edit their contents (usually button shortcuts to some IDE commands).
I would like to add the SolutionExplorer.SyncWithActiveDocument command to one of my toolbars, but cannot find it in the list of commands available for addition to the toolbar. In which category is it located? Or is it a command not supported by the toolbar system?
I don't think you can use SyncWithActiveDocument as a command - it is a manual sync that is only active when turning off "Track Active Item in Solution Explorer" in Project and Solutions -> General.
Looking at it this way, is like trying to add auto-sync to a toolbar.

Can Rhapsody be configured to use an external source code editor?

I am using Rational Rhapsody for Linux and is wondering if it is possible to configure it to open source code with an external editor instead of the built in editor. I would prefer to be able to edit code using emacs via emacsclient.
According to the documentation the following procedure should set Rhapsody to use an external editor but editing that property has no apparent effect when I attempt to edit the code of one of my classes.
Select File > Project Properties.
Select the Properties tab.
Navigate to the General::Model::EditorCommandLine property.
Click in the property value call in the right column to activate the field, then click the ellipsis (...) to open the Browse for File window.
Browse to the location of the editor you want to use (for example, Notepad) and select the editor. Click OK to close the window. The product displays the path in the property value field.
Click OK.
Have you tried the Rhapsody Eclipse Workflow integration? With that you can open your Rhapsody Model inside Eclipse, and use Eclipse as editor too.
Be careful, not all features from Rhapsody are available this way.
I have only used Rhapsody on Windows, but you have to click the "..." button to get it to break out to the external editor to edit something that showing in the properties dialog. If you want to use the external editor in this way, you have to use one that Rhapsody can execute, and then wait for it to exit, as Rhapsody will create a temp file, open the editor on the temp file, and then import the temp file back into the dialog when you close the editor.

Resources