How can I reset Xcode 4 keyboard shortcuts to the default values? Thanks.
mv ~/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings ~/
This will make a backup copy just in case. Then start XCode, view the Keybinding preferences, and restart XCode. This will create a blank default Default.idekeybindings file.
Edit: As per the comment response, first Quit XCode. Then if you want to reset a particular binding, you'll have to edit the ~/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings File and remove the <key></key> element that has the keycode that was overridden, and the <string></string> element that comes after it.
Related
I am running Brackets on a macbook pro and when I press cmd+, and try to edit the defaultPreferences.json file, it does not allow me to make any changes to the file (nothing happens when I type). If I restart Brackets I can edit the file, but after closing and re-opening the preferences file, the changes are reverted.
I have tried editing the json file with TextEdit while Brackets is closed, but Brackets still likes to reverse the changes.
I had similar issue , and i did open issue at Bracket's GitHub repository and here is the solution from its developers:-
defaultPreferences.json is a read-only file: take the options you
want to modify and copy them to the brackets.json file on the other
pane. This will override the defaults. You will also see code hints
while typing the values in to brackets.json which will help picking
the correct options.
Now it is also available to install brackets-preferences plugin and edit from there. Once installed go to View -> Preferences in your Brackets interface to edit preferences.
TextPad 7 does not auto reload. Does anyone knows how to turn it on.
I have done what I had in the past: set the Auto-Reload flag of "When files are modified by another process:" group, from the menu: Configure.Preferences. However, in TextPad 7 the files do not Auto-Reloaded.
Many thanks,
Avi
You can configure Textpad to reload the file without prompting.
Go to Configure->Preferences...->File, then select the Auto-Reload option under When files are modified by another process.
One point to note, if the cursor is at the end of the file, TextPad will keep it at the end as updates are made so the file will scroll nicely. If the cursor is elsewhere in the file, it won't scroll.
There may be some preference changes. You can configure to reload on F5 using link
http://skatterbrainz.blogspot.in/2010/11/textpad-tip-assign-f5-to-refresh-view.html
Basically under preference -> keyboard -> all command - > select FileRevert -> assign F5.
And all good
I have been searching a lot on this but of no use. Is there any shortcut to copy an entire line with a keyboard shortcut in QT creator? I have seen shortcut for cutting a line but that's not what i want..
The shortcut list is user configurable in Tools menu -> Options -> Environment -> Keyboard.
And the default shortcut to copy a line is Ctrl + Ins.
Set cursor to the line you want copy and press Command+Alt+Down or Command+Alt+Up
That's it!
You can also move a line:
Mark the line you want to move and press Command+Shift+Down or Command+Shift+Up
Cheers!
ps: clearly they are shortcuts for mac!
pps: see also https://wiki.qt.io/Qt_Creator_Keyboard_Shortcuts
Seriously, in previous versions of XCode I could right-click a file or group in XCode and I would get the "rename" option. In XCode 4 I can't seem to rename my files in XCode directly anymore. What happened? Why would Apple remove such a feature? How can I rename my nibs, image resources, and others in XCode now?
Note that if you're renaming a class, the best way I've found to do this is to open the class header, select the name of the class then control-click and choose Refactor / Rename. That way Xcode will rename the .h and .m files and replace instances of your class name (almost) everywhere it appears, including XIB files. Nifty!
Edit: in Xcode 4.2, watch out for this gotcha: "When initiating a refactoring rename operation from the declaration of a property, any Interface Builder files that refer to that property will not be updated correctly. Instead, perform the rename operation on a usage of the property, or an associated #synthesize statement."
The contextual menu item was removed, but you can still rename from within. Select the file and then click again in the name and you should get the editor field. Type away to rename. It can be a little temperamental though. The biggest problem I usually have is doing the 2nd click too quickly and it being registered as a double click. So you might need to play around with your timing a little bit to get used to it.
If you want the CM item back, make sure to file a bug report on it.
Select the file in the navigation window and press Enter.
Just the way renaming in Finder.
In case you want to change the path in case you moved some files...
Step 1: View -> Utilities -> File Inspector to open the file inspector
Step 2: Under Identity -> Path there is a white icon to change the relative path of the file
Furthermore, to rename the file, just refactor as stated above ;)
another way you can do it, is by using the little rectangle with an arrow in it which is at the bottom of the bar. Click on it, your items will be displayed in a list like view, you can rename it there the way you would rename files or whatever... Hope that helps
If you want to rename non-class files like png files just select file and choose 'Show File Inspector' from right click, then change file name from 'name' textfield (identify and type label).
I you want change class name, I recommend 'Simon Whitaker' Refactor method (second comment).
I couldn't find a way to put a bookmark inside the code in XCode 4. I know about the #pragma mark thing but it's not what I'm looking for. What I need is something that I can put and remove with a mouse click and navigate amongst with next and previous, like in VS.
Is there anything that I'm missing?
Bookmarks seem to have gone the way of the dinosaur in Xcode 4. This wouldn't have been so bad had the jump-to-bookmark popup above the editor in previous versions not also disappeared. The best replacement currently seems to be to use breakpoints (disabled individually, of course) and navigate with the Breakpoint Navigator.
Shortcut to breakpoints is Cmd + 8. Once there use arrow keys
File a bug report at http://bugreporter.apple.com if you feel something like this should be brought back.
Write below comment in your source file that you want bookmarked.
//<##>
And you can navigate to next / previous with: '^/' or '^?'
<##> means "placeholder of code snippet"
^/ means "jump to next placeholder"
^? means "jump to previous placeholder"
thanks
Another option, if anyone is still interested. The following directives will both produce a compiler warning that you can use as a bookmark:
#pragma message "<# message #>"
or
#warning <# message #>
If you want to place bookmarks using your mouse: create a code snippet with one of the 2 directives above. Drag & drop it to the line in your source file that you want bookmarked.
Navigate to next/previous with: Cmd-' and Cmd-Shift-'
In Xcode 4.4, if you leave a comment with this format:
// TODO: Your text here
it will be added as a listing in the jump bar alongside the list of methods in your current file, and then you can jump straight to that comment from that menu.
The simplest technique is to use a comment prepended by // TODO and then search, which allows you to jump through the issues from the navigator. Pretty hard to beat that technique.
I personally don't like using break points for bookmarks because it is not easy to enter notes. I use breakpoints as breakpoints, and prefer not to mix them up with bookmarks.
Anyhow, if you want to get a bit fancier you could get xcode to generate warnings // TODO: some message or // FIXME: some message that can be navigated in the issue navigator. I took the instructions below from this site:
Instructions
Head over to your project's item in the Project Navigator (usually at the very top)
Find your target in the list of targets on the left, select it
Head over to the "Build Phases" tab.
Click the "Add Build Phase" in the bottom right of this screen.
In the editor that appears insert the bash script shown below.
Now just build and you'll see all your //TODO: and //FIXME: comments have become warnings. I love this technique, it might not be right for everyone, but hope it helps someone.
Bash Script For "Run Script" Build Phase
KEYWORDS="TODO:|FIXME:|\?\?\?:|!!!:"
find "${SRCROOT}" ( -name ".h" -or -name ".m" ) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
You'll also be able to click on each of the warnings in the issue navigator to go right to the file and point in your code where you left the original //TODO: or //FIXME:
Extra pro tip: Make sure you're using phrases to describe your //TODO: comments like //TODO: Handle this error gracefully, and things like that. The phrases will show up in the issues list beside each warning.
Credit for the little tidbit should go to "Tim" on the Cocos2D forums, (found after Googling for a bit), I believe his solution originally was intended for Xcode 3 and didn't work if you had spaces in your path name, my script here doesn't have those restrictions, still he should get full credit here's his original post.
Like npellow's answer to this question of mine, appCode by JetBrains has also made this possible. So, this may be another reason to use appCode instead of Xcode4, except that it won't be free later in time.
My method:
type in grammar error code in the previous line.....
After changing something in other place, I can go back to the previous place because the grammer error line will show a red line in the right side scroll bar. It indicate the place.
It is not elegant but unless there is a bookmark feature, this is the way i am using at the moment
You can install an Xcode plugin called "XBookmark".
This plugin provide features below :
Toggle Bookmark
Show Bookmarks
Next Bookmark
Previous Bookmark
How to install XBookmark:
Install Alcatraz.
Search XBookmark from Window->Package Manager and click Install.
Restart Xcode.
Now, you can see menus about bookmarks in the Edit Menu.
PS : This plugin is open source.