Arrow keys in Xcode 6 not working - xcode

I have the weirdest issue with Xcode 6 on OS X Yosemite. For some reason I can't use the left and right arrow keys anymore to navigate within my source code. Instead, the system beep sound would come up. Up and down arrows work fine.
I'm afraid it could have something to do with my fiddling around with the key bindings. In only changed the ones for block (de)indentation though (originally CMD+[, changed to TAB), so in my understanding the arrow keys shouldn't be affected at all.

I was able to make it work again by running
defaults delete com.apple.dt.Xcode
in the terminal and then restarting Xcode.

Probably you created a conflict when customizing your key bindings.
To fix that, in Xcode settings (⌘ + ,), go to Key Bindings tab and make sure your Move Left and Move Right commands are not empty under the Customized tab. If they are, just select them and hit ⌫.

Related

xcode 7 conflicted shortcut cannot be removed

I added a shortcut key to "Clear Constraints" in the xcode preferences, and xcode installed the shortcut twice under different xcode names. (See the image.)
The problem is that there is no little "-" (minus) sign (see the red arrow in the image) to remove my duplicate shortcut attempt, because any key I press is interpreted as a shortcut combination.
The problem shortcut(s) are shown below the red arrow. The red arrow one is fine, I just wanted to show the little "-" minus sign there.
Does anyone know how to get around this problem (without reinstalling xcode and all my custom keybindings :-)). Thanks
Image showing duplicate shortcuts below red arrow
Quit Xcode. Restart the computer just to be on the safe side: we want to force Xcode to write its preferences out to disk.
Go to ~Library/Developer/Xcode/UserData/KeyBindings. Open the key bindings file with a good text editor.
You are now editing XML; I presume you know what you're doing. You will see two <dict> entries whose <action> starts with clearConstraints. Delete those entries. Save.

Why would Xcode stop drawing tabs when indent level is greater than three?

For some reason Xcode 4.5 and 4.4.1 have both stopped displaying indented text at the proper level if there are more than three Tab characters of leading whitespace on the lines.
Easier to show than describe:
There are five leading tabs on the line the arrow is pointing to, but Xcode is drawing it as if there were only three. Using the left and right arrow keys confirms the Tabs are there.
I have deleted the derived data associated with my projects, deleted the project.xcworkspace file and xcuserdata directories within the project package, mucked around with various combinations of Indentation settings in Xcode's Preferences, all to no avail.
Newly created projects exhibit the same behavior. Changing the Source Editor font preferences have no effect either. This is in OS X 10.8.1.
Help -- my brain can't understand the code when it doesn't "look right"! What else can I try?
So, I filed a Radar, then heard back from a friend of mine who was having the same problem. Are you using the new SourceCode Pro font from Adobe? Your screenshot makes it look like you might be. Try switching back to a different theme and restarting Xcode? That's what I did, and it seems to be fine.
Eventually I removed (after quitting Xcode) the entire UserData folder in ~/Library/Developer/Xcode and that seems to have fixed the problem.
Hopefully it won't take more than another half hour to restore all the key equivalents and syntax coloring that I am accustomed to.
Leaving the question 'alive' in case it happens to someone else.

Xcode 4.2.1 Code Folding

I've got a really frustrating issue in Xcode 4.2.1 on OS X Lion, where the code folding doesn't seem to work, or at least hardly every with no obvious reason.
The default keyboard shortcuts are supposed to be:
Fold Methods/Functions ⇧⌘⌥⌘← shift+option+command+left
Unfold Methods/Functions ⇧⌘⌥⌘→ shift+option+command+right
.. but I just get the Homer ('Doh'), error sound all the times I try it.
I always make sure I have the correct pane selected (before anyone asks ;o), and have also tried the following, with no luck:
- With & without Assistant editor enabled
- In a total separate editing window
- By selecting 'Code Folding >> Fold Methods & functions' from the Editor menu
- Changing the keyboard shortcut (Even tho no conflict was showing)
The only clue I have, and I'm not sure if it's related, is that whenever I press the 'option' key in the editing view my cursor changes to a + (or crosshair) - It only does this in the editing views of Xcode, however I don't think this is the issue as if I change the shortcut to not use the 'option' key, it still doesn't work.
Anyone got any ideas, as it's driving me barmy & my searches haven't come up with anything??
OK, I finally resolved to totally remove Xcode, clear out prefs and then re-install.
This seems to have fixed the issue (So far at least)
I've found that Xcode 3 won't fold unless syntax highlighting is turned on. I don't like syntax highlighting, so for lack of a better alternative I use 'View->Syntax Coloring->Simple Coloring', which only highlights comments and numbers.

Xcode: How to get page up and page down to move cursor?

This is a mac thing (because text edit does the same) but I just want to change this in xcode.
I'd like the cursor to move when I hit the page-up and page-down button. Kind of like the way windows or linux work. I know I can hold down the "option" button and then go page-up, page-down and it works - but I don't want to hold the option button.
I tried fiddling around with key bindings in xcode but couldn't get it, anyone know how?
In preferences, go to key bindings, type "page" in the search box, look for Page Down (Selection) / Page Up (Selection), click there and hit your pgdn/pgup keys.
Delete the pgdn/pgup keys from Scroll Page Up/Down.
Whit Xcode 6.1 (and >) is quite different, but similar to Colin's answer.
Xcode > Preferences > Key Bindings
Search for "Move Page Up": by default it's bindend with Alt+PgUp
You can change your binding simply with PgUp.
There may be conflicts, resolve it is suggested.
Than repeat the same for "Move Page Down".
Install KeyRemap4MacBook and life will be good. If you have a PC/Mac/Linux environment the MacOS keyboard inconsistencies can be a real pain. We have all of our Macs setup to work as PC keyboards work. Now switching from one system to the other several times a day is not a problem.

How can I jump from one placeholder to the next in Xcode autocompletion?

When Xcode autocompletes an method for me, it gives me blue blocks for parameters. I always go into the first, but then I click into all next ones rather than fast going there by keyboard commands. I guess that there are some good ones to know.
The default is Command-/, but you can customize that in the key bindings section of XCode's settings window.
In Xcode 3.2 (Snow Leopard), you can also use the Tab key to navigate between parameters. Personally, I find this more intuitive than Command-/.

Resources