Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As I am getting more heavily into programming as a job and no longer as a hobby, I am definitely in need of some ways to improve my productivity. One thing that would definitely help in that respect is being able to create customized keyboard shortcuts for text/code snippets. For instance, holding down CMD+L+O+R+E+M will output a paragraph or two of the Lorem ipsum filler text, or CMD+F+U creates a function declaration.

What I am ideally looking for is a database where I can store formatted text snippets, bind them to my choice of keystrokes, and then have the text paste whenever I perform the associated keystrokes.

Are there any stand-alone applications that can do this for a Mac. Also, are there any text editors / IDEs that have this ability built in?

share|improve this question
Moses, please re-tag this question with "mac" as well, and consider adding it to the question subject line. :) – msanford Dec 21 '10 at 18:55
I would point out that a lot of cheaper keyboards physically won't recognize as many keystrokes as are in your first example. (Unfortunately, the obvious goto here is AutoHotKey which I don't think has a Mac version...) – Shinrai Dec 21 '10 at 18:55
Agree with Shinrai. If you need more info and a good read, check out this post: – ngen Dec 21 '10 at 19:08
@msanford This question has nothing to do with Macintosh hardware (see the mac tag wiki). – Daniel Beck Dec 21 '10 at 20:14
up vote 2 down vote accepted

I've found TextExpander to be great for everyday usage but almost useless for programing.

You didn't state what text editor/IDE you use but it probably already has some flavour of "auto-completion" and/or "snippets/macros". It will be more tailored to programing and a lot more powerful than TE.

You can do this very easily in Coda, Expresso, TextMate, Komodo Edit, NetBeans, Aptana, Eclipse... I haven't use Dreamweaver since (pause, thinking...) 7 or 8 years so I don't know if you can do it. As far as I know, you can't do it in XCode, TextWrangler or BBEdit; but I might be wrong.

Of course, (Mac)Vim and Emacs have it too.

share|improve this answer
Thanks for the heads up. I'll look more into what options my IDE has for snippets and macros. This is exactly the info I was looking for! – Moses Dec 22 '10 at 20:23

This AKB article lists all the existing keyboard shortcuts for Mac OS X.

To your question of improving productivity, I really don't think that creating a plethora of 6-key combined shortcuts will improve your productivity: it will probably hinder it. Have you tried to type Command + L O R E M? It's not that easy…

However, if you still have a fairly limited set of actions you want to perform, you can create Automator scripts with extra actions to paste text into the current app, or do a whole whack of other really useful things (like executing recorded macros). Then compile your Automator scripts into Apps and assign those to custom keyboard shortcuts in System Preferences > Keyboard.

What I would suggest is a good IDE, like Eclipse, with code snippit suggesting. That will improve your productivity.

share|improve this answer

I like It works with all Macs, its free and easy to customize.

share|improve this answer

Have you looked at Keyboard Maestro? Seems like a solid product.

share|improve this answer

Thanks to you all pointing me in the right direction, I found the perfect app for what I am trying to accomplish. It's called TextExpander, and it runs in the background and listens for when I type certain keywords, like !sampleText, and when I type that and hit enter, it replaces the keyword with the text snippet I have stored.

From the examples I saw on the website, this app is exactly what I was looking for.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .