Is it possible to open a file that is not part of any project in the assistant editor? Open Quickly can open files in the assistant, but only searches the project itself. If I open an outside file in Xcode, it gets a new window that cannot access the project in its assistants.
With the assistant editor open, drag the file from the left-hand list onto the Jumplist at the top of the assistant editor (where the currently open file is).
Yes, it's possible.
#What. Your answer only works if the file is in the project. You can only drag a file to the Jumplist at the top of the assistant editor if the file is displayed within the file list on the left. This means you would have to add the file to the project before opening. Sometimes, this is not desirable as you may want to open a file from another project for reference while coding.
Steps that I use are: (Tested in Xcode 6 and Xcode 7 Beta)
In Xcode, make sure your Tab Bar is shown. If it is not, click on "View -> Show Tab Bar" in the top menu
Open the file... Go to "File -> Open". Select the arbitrary file you want to open. This will open the file in a new window. (Screenshot 1 below)
Drag the tab in the new window to the tab bar in your main editor. Now, you will have 2 tabs in your main editor and your new window will be gone (Screenshot 2 below)
Next, click on your original tab (Where your main and assistant editor is) and the file will be available in the recent files list. Simply select the file from the recent files list in the assistant editor and you now have the file open in the assistant editor. You can also close the other tab as you no longer need it. (Screenshot 3 below)
Screenshot 1. Simply drag the tab from the new window to the main tab bar.
Screenshot 2, you will now have 2 tabs.
Screenshot 3. Back at your original tab, you now have the option to open the new file within the recent files list in the assistant editor. Click it and you are done.
Screenshot 4. Final result... we have our arbitrary file open in the assistant editor.
Here is what I do (Xcode 9.3) :
Add wanted file to the Xcode project
Open assistant editor with that
file
delete this file (references only) from the Xcode project. Xcode will
remove the file from the assistant editor.
Now go to the assistant
editor "recent files", the file will be there. Select it.
My preferred way to do this is to #include whatever file I want to open in some C file, like this:
#include "/home/julius/path/to/file"
Command-clicking the path will open the file. It's a shame Xcode forces you to use this workaround.
You can drag an arbitrary file on the assistant editor. Then it will be opened there.
Related
How can I determine which editor should be called in Xcode 14.2 when I select "Open with External Editor" for a file with the right mouse button?
For me, a Markdown editor is always started, also for the Swift files.
In old tips it says you have to set the appropriate editor via the Finder. But when I open a Swift file with a double click in the Finder, it works ...
Xcode currently doesn't have a way to let you know what editor when you choose Open with External Editor.
The editor Xcode uses to open the file depends on the file type. For each file type you must set the default editor to use from the Finder.
Select a file in the Finder.
Press Cmd-I to open the file's Info panel.
Choose a text editor from the Open with menu.
Click the Change All button to set the default editor for all files of that type.
After setting the default editor, choosing Open with External Editor in Xcode will open the file in the editor you specified.
If I double click on a file in the Visual Studio Solution Explorer (VS2019), it is opened for editing in a new tab on the far left of the tab area. If I double click on another it too is opened in a new tab on the left.
In the past, I have been able to single click on a file and it was shown in a tab that displayed on the far right of the tabs area. If I single clicked on another file, it would replace the text of the first file in the same tab. I could keep doing this and each file was opened temporarily in that same tab. If I edited what was in that tab, it was moved to the left tab area and remained opened even if I single clicked on another file that appeared in a tab on the right.
This was super convenient for when I just wanted to look at a file without editing it any. Could you tell me how to do this? I looked through the configuration settings and didn't see anything. It would be super helpful for reviewing some of the hundreds of new files I need to look at in a new project I am taking over.
The setting you are looking for is Preview selected files in Solution Explorer. It can be found in the Environment -> Tabs and Windows -> Preview Tab settings page:
After turning it on, clicking on a file once in the Solution Explorer will "preview the file" (which is the official name of the feature) in a special preview tab.
I have many excel files in my computer, and the icon of all of them are plain paper, like this:
I want all icons to be .numbers icon. Do anyone know how to do that ?
Here's what you could do :
Open a Finder window and navigate to /Applications/
Find the app whose file icon you want to change
Right click it and select "Show Package Contents"
Navigate to Contents/Resources/ and find the appropriate icon file. Replace it with your new icon file.
Restart your computer to update the icon cache.
Or you can change the default app for a file type and set all files of that type to be associated with the default app if that's what your question says:
Open a Finder window and locate the file type you want to change.
Push Command+i or go to File > Get Info
Under "Open With" select the app you like. You have just changed the default app for that individual file.
To change the default for all files of that type, push the "Change All" button and then "Continue"
This will make all your excel files to open with numbers while the previous one will just change the icon
To change the file icon on all you files icons with the same extension:
open Get Info panel file 1, that you want to change
open Get Info panel file 2, that you want to change to
drag and drop icon from panel file 1 to panel file 2
click Change All...
with Finder open "Show View Options" or command + J
drag Icon size as you wish. This force icons cache rebuild
Here is a simple solution that works all times:
Find the file with icon that you want to apply for (ex: *.numbers file), then Command + i to open it's info Panel
Find the file you want to apply the icon for (ex: your *.xlsx) file. then Command + i to open it's info Panel
Now that you have your two file's info panel side by side, you can drag the icon from the first file's panel ( only from header/title bar ) and apply it to a second file's panel, as shown: (you must place the icon over the second icon to make it work, I didn't make it overlap just for taking a clear screenshot)
Open a champagne and celebrate!
You have to empty your cache for icons after you have changed the icon or switched the file association program.
Not sure the exact filename, but use it to empty both cache folders. ~/Library/Caches and /Users/User/Library/Caches
Say you have File.m showing in the blue area above.
I want File.m to open in a new separate window.
How to do this??
Note that - of course - IF you have the ProjectNavigator showing and IF you can see the filename "File.m", then double-click on the filename and it will open in a new window.
What I want to do is open ANOTHER copy of the "CURRENT" file (the one in the primaryEditor) in a NEW WINDOW - without touching the ProjectNavigator.
Any ideas? Cheers
Note that ... (an excellent page here)
http://realmacsoftware.com/blog/xcode-4-s-less-obvious-shortcuts
if you click on whatever file is in the current primaryEditor, then shift option apple comma that will indeed open the following "freaky little-known Xcode popup" ...
you can then, indeed, choose to open a new window. (So to be clear, that is exactly what I want to do.)
So, I want to be able to do that in one step. Cheers!
In XCode's Preferences you can change the following:
And then right-click within the primary editor and click "Open in Separate Window"
Edit:
Instead of right clicking in the primary editor you can simply type command+option+, (comma)
Open the file what you want to open in the NEW window.
Command + Shift + t
Open the file what you want to open in the separated window.
Command + Option + ,
I wrote a new automator service that does the following steps in Xcode:
Execute the default shortcut for the "Open in..." menu item (Command-O)
(if this isn't your current "Open in" shortcut, the workflow will not work. If you still want to test it, just changed your default shortcut :) )
Go all the way to the left in the weird "Open in" view
hit Enter
Current file opened in new window
The only thing you need to do is install the service on osx and map a shortcut to it.
Here a download to the service:
https://www.dropbox.com/s/486t2iz17o0l9dh/Open-New-Window.zip
INSTALL INSTRUCTIONS
1.Place Service file in folder ~/Library/Services
2. Open "System preferences"
3. > Keyboard
4. > Tab "ShortCuts" > "Service" > "General"
5. > Set your own shortcut for the service
6. Go to XCode and test the service by using your very own shortcut
Tested on OS X Mavericks, Xcode 5.0.1
In XCode 4 you can have a split window via View -> Show Assistant Editor. Then choose the same file which you have already opened in the Primary editor by the small right arrows on top of Assistant Editor.
Thanks
in the ProjectNavigator. If you see the file name: Double click on the file name. It will open in a new window.
So I used Xcode and all. Now, whenever I open my text files it opens automatically with Xcode. How do I undo this?
RightClick on the file name -> Open With -> Choose the editor you wish to open with this kind of file. And that sets to be default editor for opening files with that particular file extension ( i.e., .txt ) when opened in future.
Edit: The above procedure is not a permanent one. Try this -
Right click on the file name.
Choose Get Info
Choose one from the Open With drop down. This will be set as default application and is used in future if opened the .txt file.
Right-click any text-file an select "Get-info", then choose your preferred Text-editor under "Open with" and click "Change all..."
You can change program association by right clicking on your file and clicking on "Get Info". This will bring up another dialog in which you can change the program associated with that file type.
You can find visual instructions here: http://osxdaily.com/2009/10/25/change-file-associations-in-mac-os-x/