Re: Customizing spacing in auto-completed methods?
Re: Customizing spacing in auto-completed methods?
- Subject: Re: Customizing spacing in auto-completed methods?
- From: Fritz Anderson <email@hidden>
- Date: Thu, 13 Mar 2014 15:55:20 -0500
On 13 Mar 2014, at 1:52 PM, Jens Alfke <email@hidden> wrote:
> IIRC, there is a way to customize the spacing of the method calls and declarations that Xcode's autocomplete inserts. (I think it involves setting some user defaults.) I’d like to do this, because my coding style is a bit idiosyncratic and I put spaces in different places than Xcode puts them.
`defaults read com.apple.dt.xcode` doesn’t turn up anything interesting when you search for `spac`.
> For example, I put spaces after the “:”s in a message expression. And in a method declaration I space it like
> - (id) initWithFoo: (Foo*)foo
> instead of
> -(id) initWithFoo:(Foo *)foo
Yes, I call it “whitespace causes cancer” formatting. You’ve put a space after the return type, which is libertine; but you are permitted one _before_ the return type, so be grateful for the crusts you’re given. Apple’s committed, and I bet it’s easier to script against, so I’ve given up on complaining.
> I believe there are, or used to be, defaults to customize all of that spacing.
Maybe I remember such an option, possibly in an Apple IDE. I don’t think it was in Xcode 3. I just looked at the TeX and all my screenshots for my Xcode 2 book, and couldn’t find a reference. But I also couldn’t find an apposite use of the relevant preferences panel, or \bindent, so that may not be any indication. And that was 2005, so I can’t remember directly.
What I might be remembering instead is the panel that to this day sets colons (among other things) as triggers for re-indenting a line. Preferences > Text Editing > Indentation.
There are options to do exactly this in Accessorizer. And maybe in other editors along the way. That could be clouding my memory.
> (I know some of these autocomplete things are snippets, so I should be able to edit them in the snippet viewer in the right panel. The viewer claims to let me edit them, but when I press the Edit button everything remains disabled and non-editable. Bug?)
A misfeature I can sympathize with, rising to a bug because (as you say) Xcode affords an Edit button but doesn’t let you edit. And there’s no way to copy the snippet itself (you can copy the content) or cmd-D duplicate it. And even if you could, there’s no way to edit the original’s trigger to get it out of the way of your replacement.
If I were a better citizen, I’d file a Radar, but I was not excited about spacing, so I did not object…
— F
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden