Writing Tool for Programmer

Hello, I am a programmer and writing includes code snippets. I am finding it difficult to use the empty template. It lacks code formatting. Is there any template that I could use?

Do you happen to use TextMate? If you do, and are still on Tiger or a version of Leopard that still supports input managers, you could see about installing the Edit in Textmate plug-in which would let you select a document in Scrivener, choose that option from the Edit menu, and then have full access to TM’s code support. Saving in TM will update Scrivener.

If you are looking for full code format export in Scrivener, though, you won’t find it. The best you can do is put your code snippets in their own Scrivener documents, and make sure to check the “Preserve Formatting” option in the Inspector. Then you can apply whatever font/colour/rule attributes you wish and they will not be wiped out when compiling the draft.

AmberV wrote

If you have Leopard then you have to use Terminal to get things to work. Check
blog.macromates.com/2007/inputma … n-leopard/

Essantially you have to enter the following commands in the Terminal

After you’ve done things described there, start Scrivener (or any other Cocoa App) and the menu item “Edit in TextMateâ€

That is serious (and potentially system-dangerous) overkill for something than can easily be done in the Finder…!

Do those instructions still work for 10.5.1, though? I had it working in 10.5, but in the last update it stopped working for me.

Antony—what part of that can be done in the Finder? I suppose if there is a safer way of adjusting these system settings it would be good to have them—but as far as I know, there are no Mac Finder ways of doing some of these things here.

The risky move is the last command, which grants root ownership to everything in that directory. Since Input Managers are kind of a security risk anyway (which is why Apple is phasing them out), it’s a bit like using an easy to guess password in Windows 95. Point is, if somebody wanted to wreak havoc with InputManagers, they could do it without the root ownership.

All of it, apart from the last global root command, but that’s not necessary for Input Managers anyway. Just setting them to admin ownership (if they aren’t already) should be enough.

I’ve installed several IMs on my 10.5 systems (Inquisitor, PicLens, Plaxo) by just manually creating the folders and making sure the IMs went in the right place. Didn’t have to go near the Terminal.

True, but those terminal commands are doing just that - creating the right folders and then setting the permissions correctly. I don’t see the overkill :stuck_out_tongue:

But then I never use 23 clicks where 4 lines will do :slight_smile: Hangover habit from being a dirty *nix user.

Yeah, I guess I’m the same way. I trust the command line tools way more than dragging files around that need specific permissions, and Apple’s permission tool—especially Leopard’s—which seems to have an ornery mind of its own! And yes, the whole 23 clicks thing. :slight_smile:

Ahem, versus 231 characters that have to be typed perfectly?

:slight_smile:

Dave

(Former, not lamented, unix sysop who still uses the terminal when he has to.)

Perhaps two separate issues are getting confused in this discussion, then – how you make the changes, and what changes are necessary. The script sets the permissions to root:admin, but if I’m understanding you correctly, one could instead change that line to set permissions to <an_admin_user>:admin, whether in the Finder or via the commandline:

sudo chown -R <an_admin_user>:admin /Library/InputManagers

Or have I totally misunderstood? Maybe that’s not truly much safer than root (or perhaps I’m suffering mental bit-rot given that the most exciting thing that happens in my system is the appearance of “Stealth Mode” in the logs?)

Bryce

Ugh, tell me about it - just did a migrate after upgrading my HDD in my MBP (300GB usable…woo!), and my Library and Application folders are all referring to ‘_unknown user’ for read and write permissions rather than System like they should.

I could go through and set them using Leopard’s permissions manager, one by one, and maybe they’ll take and maybe they won’t. Or, I could use chown and do it in one foul swoop :slight_smile:

Yah, Mac OSX’s window manager is a beautiful thing, but that doesn’t make it perfect for everything (and I hear we’re due a good number of fixes for Leopard’s borked permissions system in 10.5.2).

Yeah, as Dave says, my problem with this sort of method - especially when you’re giving the advice to users who aren’t familiar with Unix* - is the potential for disaster if you type something wrong, or inadvertently enter a command without fully understanding what it does. Particularly when sudo is invoked…

For something system-wide, of course you’d use the Terminal, but I would also always stress the importance of accurate typing. For something that’s essentially just creating a couple of folders, I’d always rather stick with the Finder - at least that way I can move stuff out of the Trash if I mess it up :wink:

*Not necessarily the OP in this case, but there are plenty out there who might have the same problem and decide to try it out…