tags:

views:

26

answers:

1

I am trying to use the a macro in xcode.

I type in a then hit escape and select it.

This is annoying because I have to hit page up 5 times to get to the a.

Is there a different key combination that will just let me use the a as typed without having to select it?

A: 

Have you changed your XCode defaults? I'm using 3.1.4 and I don't have to hit page up. Here are my exact key presses:

  • a
  • escape
  • enter

I can also hit escape first and start typing the macro name.

Edit: Argh! Your demon has infiltrated my XCode! ;) If I auto-complete some things, they become sticky as the new starting "a" macro--I can't even backspace and type "a" to use the first "a" macro. Each file has it's own persistent memory too, so switching files changes the default. Using a method or property or any other parsed symbol seems to have priority over the macros so the default will never go back to the initial "a" macro once you auto-complete a parsed symbol.

Pretty weird bug. I must not have seen it because I don't use macros much.

The only way I found to fix this is to change the "a" macro to some other auto-complete such as "ai". That way when you type "a" "escape", typing "i" next will select the macro you want even if there's a bad sticky default.

Start with this reference http://mcdevzone.com/2009/04/09/useful-xcode-tricks/

Then edit "~/Library/Application Support/Developer/Shared/Xcode/Specifications/TextMacros.xctxtmacro/Contents/Resources/ObjectiveC.xctxtmacro" and change the "CompletionPrefix = a;" to some other prefix.

When you restart XCode, the new prefix will work in place of the old "a" macro.

Ken Fox
have not changed any defaults.... an example is I type in a and it goes to a function parameter that starts with a instead
Mel
what project type and files are you using? I only use XCode for Cocoa apps.
Ken Fox
iPhone application... I also see it if I have a property of my class that starts with a. It goes to the property first. This isn't happening to you at all?
Mel