Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm looking for a simple software which would do this:

When I type in something like dbs and hit tab or enter, it will replace dbs with $this->db->set() in the program that I typed it in.

It needs to allow for multiple such shortcuts/templates. If there's a way to only put in these shortcuts in a specific program, or to dictate where the cursor should be put, that would be an added bonus.

The reason I want this, is because I'm too used to code templates in Netbeans, however in the latest version, they're broken for me.


share|improve this question

closed as off-topic by DavidPostill, Mike Fitzpatrick, Matthew Williams, Art Gertner, bwDraco Jan 19 at 15:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – DavidPostill, Mike Fitzpatrick, Matthew Williams, Art Gertner, bwDraco
If this question can be reworded to fit the rules in the help center, please edit the question.

Operating system? – Bob May 21 '12 at 1:29
@Bob Windows XP ---- – Click Upvote May 21 '12 at 2:08

2 Answers 2

You can do this with Hotstrings in AutoHotkey. For example:


Unless the asterisk option is in effect, you must type an ending character after a hotstring's abbreviation to trigger it. Ending characters initially consist of the following: -()[]{}':;"/\,.?!`n `t (note that `n is Enter, `t is Tab, and there is a plain space between `n and `t). This set of characters can be changed by editing the following example, which sets the new ending characters for all hotstrings, not just the ones beneath it:

#Hotstring EndChars -()[]{}:;'"/\,.?!`n `t

The default EndChars includes tab and enter, but you may wish to remove some of the ending characters. The defaults appear to be chosen specifically for programmers.

You can make it program specific with #IfWinActive, for example:

#IfWinActive ahk_class Notepad

#IfWinActive affects all hotstrings defined after the directive, as described at the linked page. The ahk_class can be found with AutoIt3 Window Spy, a program included with AutoHotkey. You can also use window title, partial title, pid, etc.

share|improve this answer

You may be able to use AutoHotKey ( for this. You could listen for "d" "b" "s" "|" and replace it with "backspace" x 4, "$this->db->set()" etc. For example.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.