Xcode keyboard shortcut for Find Anything - xcode

In JetBrains IDE's - in particular AppCode or Intellij - there is a Find Anything command that is Command-Shift-A that allows searching for any IDE related Action in a convenient modal dialog. Is there an equivalent in the Xcode?
An example use-case: there are SOF answers mentioning Solution -> Open Target. I can not find either Solution or Open Target in the Menus. I even employed the CheatSheet application and pored over every available shortcut. If there were a Find Anything then I could put in the terms Solution and/or Open Target and a list of related Xcode/IDE actions would be presented.

Pressing command+shift+f will jump you to the “Find navigator” where you can search through your current project. This is great if you want to do free-form searches anywhere in your project and includes options for case sensitivity, context (e.g. search for anywhere for text or just expressions beginning with the search term), regular expression searches, etc. See Find and replace content in a project.
The command+shift+o (the letter “o”, not the number zero) will pull up the “Open Quickly...” search dialog where you can search for symbols in both your project as well as the frameworks. See Open a file containing a symbol.

The Xcode replacement for Android Studio's/Jetbrains "Find Anything" command (which is not the Quick Open) is:
command + shift + ?
This opens the Help menu ready to type into the Find Anything search, where you can search for Xcode's own commands, for example Reveal:

Related

Is there a button or keyboard shortcut to “Find Next In Project” in Xcode?

In Xcode, you can use Find → Find Next or CommandG to find the next result matching the current search, but only in the current document. Is there a similar command that will find the next search result in a project-wide search? This would be similar to how Navigate → Jump to Next Issue (Command') works, except for Find results instead of compiler issues. It should jump to the text itself in the editor, not the listing of the find result in the sidebar.
Xcode 8 has this, use ctrl-cmd-G.
Go to Xcode Menu --> Preferences --> Key Binding -->Find Menu, then you can see what are all options available and you can cofigure those.
If you can't see the desired option here, then you can't.

How do you find all references to a method or property in Xcode?

If you have a method, e.g., loadMediaImages in a .h file, how do you find all references to that method in the project? In Visual Studio there is a "Find All References" option on the content menu when you highlight and click the method name. Anything similar in Xcode?
Using the "Search Navigator" it's possible to search for symbol references within a project or workspace. Click on the little magnifying glass icon in the search box to "Show Find Options", and then select the Style: Symbol References.
Note: This is in Xcode 4.6, but may have been present in earlier versions.
I was looking for similar option. I do not know why Xcode did not included that.
But there is a work around I use until Apple give that option in Xcode.
Try this in the source code (.m) file,
Select the symbol, right click -> Refactor -> Rename
-> Give a name whatever you wish, then press Preview.
Now you can see all the references. You can Cancel/do not rename it. :)
Or press Cmd + Shift + F, and choose optons Find > References > Matching or Containing. But it will search all text with similar name. Not elegant like Refactoring.
You could do a search in the whole project... I don't have a screen ready but I know Xcode can.
Haven't seen this in Xcode. Just FYI you are able to do that with AppCode though.
If I'm not mistaken, Xcode 4 (not sure about previous versions) does not support a Find All References search. You can perform a text search within the entire project by pressing Shift+Cmd+F (Find in Workspace in the Edit menu), but this does not find exact "references", just matching text. You're best bet is using the Refactoring menu, as talked about in Finding all references of a variable or a method in Xcode4, but it is not very clean and requires more work than it should.
Find selected symbol in workspace is what you need
right click on the method/property -> Find -> Find selected symbol in workspace
focus the property/method and press ⇧ + ⌃ + ⌘ + F (or you can have a custom one)
Does basically the same search as Refactor -> Rename does

How am I using Xcode Search incorrectly?

Xcode search just isn't working the way I expect it to. What am I doing wrong?
"Project Find" (cmd-shift-F) often turns up zero results when I KNOW that there are valid hits. For example, searching for "Search Results" (no quotes) ironically returns 0 hits, even though I have a .m project file open with the string #"Search Results" sitting right in front of me. My Find Options are set as loosely as i can make then, case-insensitive, Search In Open Projects, All Candidate Files, All Files in this Project, etc.
The Search bar in the upper right of my main project window doesn't seem to behave like Project Find, nor does it seem to search the currently open document. What does it do?
Searching for "UIView" in the Help menu search turns up zero hits, even though if I open up the Developer Documentation from the Help menu and search from that window it returns plenty of hits.
Help menu searches only for menu entries (try searching for "Paste") and end-user documentation (how to use the software itself, not how to develop it).
Use documentation viewer to search within developer documentation (it lets you switch between fulltext and API names search, select OS version and language).
Check what options you've set in project search – it might be set to match whole identifiers only, be case-sensitive, search only selected files, etc.
Select:
In Project
Textual
Contains
Ignore case
Uncheck:
Display Resutlts in Find Smart Group
This might help :
If you are searching files in project then select "Ignoring case". Below is screenshot for the same.
If you are searching a particular file then select magnifier -> Edit finding option.. -> Select/Unselect Matching case accordingly. Below is screenshot for the same.
In my case the Pods project had an issue and Xcode could open it. Thus, although the files were there, Xcode could search through them.

Switch to tab by typing a substring of its name in Visual Studio 2005

Is there a way to navigate between tabs in VS similar to the emacs iswtichb-mode or Firefox ubiquity switch tab mode (https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial#Switching_Tabs) ?
In these apps, you just type a substring of the title of the tab (or buffer for emacs) to switch to this tab. For instance, to switch to a tab named "App_Code/Data/MyProgram.cs", you just invoke the tab switching command and then type "Progr" for instance to list all the tab whose name matches this string, including "MyProgram.cs".
It's much easier to switch between tabs this way when you have a lot of documents open and when you now where to go (which is the case in most situation)
Thank you !
Visual Assist has a function "Open File in Solution" (shortcut Shift-Alt-O), where you can type the filename and list of matching files from the solution is shown. Once you are happy with the selection, you can confirm it by pressing enter, or you can click the file you like with mouse.
As added bonus, this way you can also switch into files which you do not have open in a tab yet.
No this is not a supported operation in Visual Studio. It can be done by adding a Macro or via a plug-in though.
ReSharper will do something similar to this for you. It's not free, but it has many really nice features.
Invoke with Ctrl+T, then start typing the name of a file. It will provide you with a list of matches while you type. It's not limited to open tabs; it searches all files in the solution.
The search is intelligent. For example, if you have ThisIsMyClass.cs, typing 'TIMC' or 'ThisIMCla' will still match based on the idea that capital letters begin new words in file names.

Is there a keyboard shortcut to quickly find and open a file in Visual Studio 2005/2008 like how they do it in TextMate?

Is there a keyboard shortcut to quickly find and open a file in Visual Studio 2005/2008 like how they do it in TextMate?
In textmate Command + T in Textmate brings up something that you can type a few key which would display all relevant files and allow you to quickly select one, Command + T back and forth also allows you to quickly alternate between 2 files most recently used. This is extremely helpful.
I am aware that there is a Ctrl + Alt + ↓ which shows a list of all open documents which is almost there but not quite.
You can hit Ctrl+D to go to the search box, then type >of filename (with autocomplete).
You can also do this and other commands in the command window or the immediate window.
Or, if you don't mind buying, ReSharper has Go to File which I highly recommend. It's Ctrl+Shift+N and it brings up a nice search dialog that supports wildcards and other shortcuts.
Sonic File Finder is a free VS plugin which is basically the same thing, and quite well-loved by most people who install it.
http://www.jens-schaller.de/sonictools/sonicfilefinder/index.htm
I think the best solution is the following
CTRL + , (comma) then type your file/class/method name
I've made an extension that works exactly like Textmate's "go to file" feature: https://github.com/maxt3r/VS-CmdT
If you go to the search box in visual studio and type ">open " and then start typing, autocomplete will come up for all the files in your solution. This is in 2008, not so sure about 2005.
Out of the box in Visual Studio, Ctrl + Tab will toggle between the two most recent files.
Ctrl+Shift+T in Resharper works just like you describe. It provides a text box in which you type the filename and it generates a live list from which you can pick from. Nice features include wildcarding (e.g. Customer*xaml) and matching on camel case filenames (e.g. SVD will match SingleValueDecomposition.cs). At my work, if people use one feature of Resharper, it will be Ctrl+Shift+T.
If you code in C++ rather than C#, then Visual Assist provides some functionality. And in my opinion, works better than Resharper.
Sara Ford has a blog post about this: Did you know... How to open a file in the solution without using either a tool window or a dialog?
All the previous responses are accurate and are mentioned in her post and the comments. In addition, another approach is to launch the command window using CTRL+ALT+A then typing in "of filename" or "open filename" in the same way mentioned for the search field.
#Adam Neal mentioned ReSharper. Another popular tool is CodeRush/Refactor! Pro and it also has a file navigation window that can be launched (and searched) via the CTRL+ALT+F shortcut.

Resources