Who is this tutorial for?

- jEdit lovers who have yet to discover the power of abbreviations and the SuperAbbervs plugin.
- Those new to jEdit who want to give it some killer functionality
- People looking for documentation or a manual on how the hell to use Abbreviations and SuperAbbrevs
- Those looking for yet another reason to switch to jEdit, one of my very favorite programs.
- Those looking for Textmate-like functionality in another editor
- People coding in HTML, XML, Ruby (on Rails) and any other language. I will be using HTML and RoR for my examples since that’s what I code my sites with, but you can apply this stuff to any language.
What are abbreviations and SuperAbbrevs?

One of the cool things you’ll see in Ruby on Rails videos when people are using Textmate is that someone will type something like:
linkto
and it will output:
<%= link_to '', :action => "" %>
Or maybe you just wanted to be able to type table code really fast when you’re doing HTML:
table
output:
<table>
<tr>
<td>
</td>
</tr>
</table>
This is an abbreviation. It takes a simple text input and makes you more efficient by giving you a code output at the touch of a key that would have been much more laborious to do all by hand. Basicially it just saves you a ton of typing. So whether it’s a huge statement you want to output or a small set of HTML tags you can save yourself a lot of typing with this little thing. Isn’t that convenient? And you probably thought you had to have Textmate to take advantage of such an awesome feature (I believe they call them “snippets”). That is most certainly not the case.
Examples of where you might use it
So. In what situations can you use jEdit’s awesome abbreviations or SuperAbbrevs plugin? Here are a few examples:
| Text input | Code Output |
|---|---|
| table | <table><tr><td></td></tr></table> |
| pe | <%= %> |
| trtd | <tr><td></td></tr> |
These are just some of the things you can do with them. As you can see you can use them for a lot or a little code. Personally I hate going very far away from the home row on my keyboard at all (which is why I also use dvorak), so even the pe abbreviation to save me from having to type <%= %> is a real life saver; it’s just such a pain in the ass to find that % key sometimes.
The HOW-TO
I’m just going to show you how to use SuperAbbrevs because I believe they are superior to Abbreviations built into jEdit for how most people will want to use them. If you want to play around with Abbreviations they work similarly and can be found in Global Options in jEdit.
On with the show!
First you need to get jEdit. You should either have it already or get it right now.
Installing SuperAbbrevs
- Go to Plugins -> Plugin Manager.
- Click on the Install tab.
- Find and click the checkbox for SuperAbbrevs
- Click Install at the bottom lefthand corner
- Close that dialog
Setting up an Abberviations Shortcut
- Go to in the file menu Utilities -> Global Options -> Shortcuts
- Click on the dropdown box and select Plugin: SuperAbbrevs
- Double click on either the Primary or Alternate shortcut box. It should bring up a dialog that says Specify Shortcut
-
Press the keys CTRL and Enter similtaneously on your keyboard. This sets up a key combination to expand your text input abbreviation into awesome blocks of code.
Making an abbreviation
- Go to Plugins -> Plugin Options -> SuperAbbrevs
- At the top click on the dropdown for Abbrev set and select global
- Click the little + (plus) icon at the bottom left. This will open a box that should say Edit Abbreviation.
- The box labeled Abbreviation is where you type what text input you want to use. For this example we’ll be typing table in it.
- The box that says Template text is where you enter the code to help you display your abbreviation. In this box we’ll type:
<table>
<tr>
<td>$1</td>$2
</tr>
</table>$end
Click OK
- This tells jEdit that we want to be able to type table and then hit ctrl+enter on the keyboard and it will output a table for us. The numbers with the $signs in front of them represent spots where you want to be able to tab to.. So in other words you can press tab and it will go to each one of the numbers and you can type whatever you want in them. The $end variable represents the end of your expanded code. If you type anything at this point you will exit the abbreviation and go back to normal editing.. so basically you just can’t tab/shift+tab through the abbreviation anymore.
Using your abbreviation
- If you haven’t already press OK to exit the Plugin Options dialog
- Open a new buffer or some other html document that you can type in
- Type table somewhere in your document and then press CTRL+Enter on your keyboard. You should see this:
<table>
<tr>
<td></td>
</tr>
</table>
If you don’t, then go through the steps again and make sure you have everything done the way I show it in the screen shots.
- Your caret should be located between the two td tags. Type hi.
- Press Tab on your keyboard. It should go to the outside of the last td tag. Press enter and type:
<td>hi again</td> - Press tab a few more times. It should cycle through all your different edit areas of your abbreviation.
- Stop tabbing sometime when it gets to the end of the table tag. Type something. Now press tab. You’ve just exited your abbrevation!
More Examples
- Here’s a PHP example. I use fun for the abbrev and the following for the expansion:
function $1(\$$2)
{
$3
}$end
This is an example of how you can escape the $ character. In this example you actually don’t need to.. the only time you need it is if you put a number or the keyword end after the $ sign. But it won’t hurt your abbrev in this example either.
-
Try this in a superabbrev; I use the abbrev img the expansion is:
<img src="$2" alt="$1" />$end
This shows that you can put things out of order.. maybe it will remind you to actually type something in that alt tag. - Often in Rails you’ll want to type out a link_to tag in your views. Maybe you don’t always remember what to type where. In this example I use linkto as my abbrev and the following as my expansion:
<%= link_to '${1:name of your link}', :action => '${2:name of your action here}' %>$end
Type linkto in your document and then press ctrl+enter (or whatever your expansion key combo is). It will expand your abbreviation and have example text in place so that you can remember what goes in those.
- Try writing out an superabbrev and putting the variables ($1, $2, $3..) in multiple times. So like:
<img src="$2" alt="$1" title="$1" />$end
You should see whatever you type in the alt ($1) attribute is the same in the title attribute. By the way - don’t ever do this as a real abbreviation. This is a misuse of the alt and title attributes and anyone caught using this in a real production scenario should be shot. This is just an example.
Nice work. If you kept up with me that whole way, go you. If you have questions or comments.. please comment.
Notes
- You may not want to set Abbreviations for global. You can select them to only work for certain languages if you want. This way you can have the abbreviation “b” make a bold tag in HTML and then have it do something entirely different in RoR like write out “before_create” or something. That’s not a very good example of what you’d really use it for, but you get the picture.
- There’s more you can do with abbreviations and stuff. Play around with it.. and look at documentation (Help -> jEdit Help -> Search. Then search for “abbreviations” or “superabbrevs”).




February 22nd, 2006 at 22:45
very good!
March 1st, 2006 at 02:39
Thanks for the tip!
I’ve been looking for a solution like this.
I’m reluctant to try an Java based IDE, but this just might be the deciding factor.
Thanks!
April 29th, 2006 at 07:01
The beta version of SuperAbbrevs can be found here.
http://community.jedit.org/?q=node/view/2761
http://community.jedit.org/?q=node/view/2762
June 3rd, 2006 at 21:31
Should’ve posted this here a while back - inspired by this tutorial and a couple others, I created a collection of jEdit snippets for Rails:
http://synthesis.sbecker.net/articles/2006/03/20/jedit-snippets-for-ruby-on-rails
June 10th, 2006 at 18:28
HECK 2 the YEAH! GREAT POST DUDE!
July 4th, 2006 at 19:14
Or use AutoHotKey and get superabbrevs functionality across all Windows apps, not just jEdit.
Actually I just used it to fill in the blog info above–I typed in ja` for my name, mail` for my email, and web` for my website.
July 30th, 2006 at 08:53
Excellent resource! I’ve included a link to this in an article on jEdit and other RoR IDEs (jEdit being my personal fav). Thanks for explaining abbreviations in detail so people can easily understand it!
August 17th, 2006 at 12:07
If you find that tabbing between $ variables is broken (gives a Bean Shell error on an undefined method), you will find that Jedit 4.3pre6 will work with the beta SuperAbbrevs mentioned by Sune (http://community.jedit.org/?q=node/view/2762). The beta description only mentions 4.3pre3 and pre4, but it works with pre6. The non-beta version has problems with $ variable processing.
August 25th, 2006 at 15:56
Hehe I didn’t even know about that, I will update the description.
I am really busy at the moment so thats why nothing is happening to the plugin rigth now. But I try to get the time to release what I have for 4.2 before it’s too late :-)
August 28th, 2006 at 01:28
[...] dit mit dem SuperAbbrevs-Plugin und diversen anderen Plugins ist sicher eine gute Lösung. Hier das Tutorial dazu. [...]
September 7th, 2006 at 06:07
There is a new beta version of SuperAbbrevs avialable from the links below.
http://community.jedit.org/?q=node/view/2761
http://community.jedit.org/?q=node/view/2762
September 14th, 2006 at 16:45
It seems to me that SuperAbbrevs no longer offers a shortcut to expand the abbreviation you just typed. Now it launches a dialog into which you type the abbreviation and the expansion is inserted at the cursor.
This is a step backwards if there is no way to go back to the former functionality.
September 17th, 2006 at 04:36
Hey Alex Ezell
Write the abbreviation and press the TAB key, then the abbreviation should be expanded.
September 24th, 2006 at 23:51
[...] , which simulate all the TextMate snippets and more. There’s also a good tutorial on setting up the SuperAbbrevs [...]
September 28th, 2006 at 17:41
SuperAbbrevs beta 3 is out, this time the jarfile works for all version of jedit after 4.2.
http://community.jedit.org/?q=node/view/2761
September 29th, 2006 at 00:14
[...] for a number of reasons. jEdit Tutorial: A How-To on [...]
October 8th, 2006 at 12:12
Hi, do you still have the file with jEdit snippets for RoR from here (http://synthesis.sbecker.net/articles/2006/03/20/jedit-snippets-for-ruby-on-rails)?
If you have i wuld thank you a bunch if you could send it to me, or put somewhere for downloading, as the original download appears to be down, and the blog appears to be forgotten.
Thanks
P.S. Actually, uploading it would be a better option, as I seen many who seek this file in vain.
October 8th, 2006 at 21:57
[...] 2006 for nothing. Have several bundles to use. Whew.. Cool. Then there’s this great tutorial [...]
October 22nd, 2006 at 18:27
Found a set of shortcuts at http://dovetailcomputing.com/blog/2006/09/18/using-jedit-for-ruby-on-rails/
December 11th, 2006 at 18:38
SuperAbbrevs 0.23 has just been released to the plugin manager.
Enjoy !
December 14th, 2006 at 07:15
[...] s que usei para configurar:
http://www.eadz.co.nz/blog/article/ruby-rails-jedit.html
jEdit Tutorial
Rad [...]
January 24th, 2007 at 08:47
hey dude. Nice tutorial. Im more interested in mixing “variables” of abbreviation. SuperAbbres can’t understand something like this: ${1:class=”${2:inner}”}, TextMate can and i really miss this option.
Has anyone an idea how to make it work? thanks
January 29th, 2007 at 03:09
[...] s pluging is impressive because it introduced a block of code and markers you can jump to. Here is a nice tutorial [...]
January 30th, 2007 at 17:46
Hi hrax
I’m Sorry but that feature is not in SuperAbbrevs right now, and it will be a while before I get around to implement it. There are so many other improvement and refinements I want to make first.
February 6th, 2007 at 02:18
Hey thanks for the tips. Was really very helpful in understanding the jEdit. Keep up the good work.
February 19th, 2007 at 22:51
Can you wrap text in tags? Please email me if you can.
Robert
March 1st, 2007 at 15:18
Yes you can wrap text in tags. Use the following template:
Select the text you want to wrap, and invoke the action
Plugins -> SuperAbbrevs -> Show expansion dialog
write the abbreviation for the template above and hit enter.
The selection will now be wrapped in tags.
March 17th, 2007 at 09:52
Hi,
I’m obviously missing something here. I’ve just started using jEdit 1.5.0_06 and when I tried to get SuperAbbrevs going - no luck. The boxes I get look somewhat different to those shown above, also it seems that SA is already installed as it comes up in the Plugin Options dropdown and shows Tab, Shift Tab and Show expansion dialog options.
When I type “if” and hit Shift Tab, an Add Abbreviations dialog comes up and I can insert the extended code into page. But this is obviously not what people are talking about.
Any help very welcome
March 18th, 2007 at 07:00
thanks for the help. setting up and workin gwith the plugin was grat. but i have a problem with assigning + keystroke to “Expand abbreviation” cause its not on the list when i selected plugin:SupperAbbrevs
I only see three items there, namely: Tab, Shift+Tabl, and Show expansion dialog…
I tried reinstalling the SUperAbbrev plugin but it didnt change a thing. WHat should i do?
March 31st, 2007 at 14:37
Hi Roy & Gerald Redila,
First to you Roy, the SuperAbbrevs plugin is only installed if you isntalled it. And the version of jEdit you mention does to my knowledge not exist. I think you eighter uses jEdit 4.2 or 4.3pre. The plugin works like this: You types an abbreviation in the text area and hit tab, if the abbreviation exist for the editing mode you are in the abbreviation will be expanded. When you hit the tab key again the first field will be selected. By using the tab key you can jump between the fields in the code template. Here is a demo of the plugin in action http://www.we-knowhow.dk/jedit/demo.html .
Gerald Redila, the new version of the plugin uses the tab key to expand the abbreviation like explained above.
Hope this clears things up a bit.
May 12th, 2007 at 16:15
For those of you who aren’t happy with using the Tab key to expand abbreviations in SuperAbbrevs, you can change the Tab _shortcut_ from the Tab key to something else. For example, I switched to the backtick:
Tab: `
Shift Tab: S+`
I switched it because I have the Tab key set to indent lines (for emacs-like behavior) and SA was breaking it. I’d love it if the behavior of Tab was context sensitive but I couldn’t see any easy way to do it. Maybe a macro…
Also, Sune, if you’re reading this, where is the definitive page for SA? The links above all appear to be broken. Thanks for the great plugin.
May 14th, 2007 at 23:59
[...] 21; window. Also see the excellent tips on Eadz’s Ruby on Rails on jEdit page, and this howto on setting up [...]
May 27th, 2007 at 16:47
Hi Matt Gordon
There is no definitive page for SA, the links above are for beta version. The newest version is included with jedit in the plugin manager.
Regards Sune Simonsen.
June 20th, 2007 at 18:46
Thanks for this post!
September 4th, 2007 at 14:09
Thanks!
After using jEdit for 7 years now, it is nice to still learn something new. I had been using the regular abbreviations built in jEdit, but it was nice to find that there is such a plugin that makes those multi-part abbrs easy as pie.
This will help me with xslt which is an insanely verbose language :)
Cheers!
November 9th, 2007 at 14:53
Thanks for the great article again. It’s hard to go from Visual Studios to JEdit but I’m hoping this will be my editor of choice after a few weeks. I would like to say as a ‘newbie’ to Jedit, you need to go into options and select Plugin Manager and then download the mirrors and select a mirror before your plugin manager will function correctly. This is from a fresh install only I think. Thanks, Jonathan
February 5th, 2008 at 14:05
Super useful - I was trying to find out how to have text in the areas to fill in, and here it is.
February 6th, 2008 at 16:10
Hey, thanks for the good writeup. However, when I go to Global Options -> Shortcuts, and pull down SuperAbbrevs from the pull down list, there is not an “Expand Abbreviation” command listed. Only “Show dialog window” and “Tab” are there.
So, obviously I can’t set a command to expand the abbreviation. Any idea how to get it to show up for SuperAbbrevs?
February 6th, 2008 at 16:14
Hey Brian -
Yeah I see that too. Use “tab” which is the new way Sune is saying “Expand Abbreviation”.
February 6th, 2008 at 16:57
Unfortunately, no it doesn’t seem to change a thing. I have the abbreviation for ” Shortcuts, I even changed “tab” to be SHIFT+ENTER
now when I type “$end
I can get the normal built in abbreviations to work, just not the SuperAbbrev ones. Its like it isn’t even enabled, or isn’t running, or something. But it clearly shows in the plugins manager that its installed and checked.
February 6th, 2008 at 16:59
whoops… your blog totally stripped out all the code I had in there, probably doesn’t make any sense now.
February 7th, 2008 at 10:15
Hi Brian,
The tab-key should be wired to the Tab-action when you install SuperAbbrevs.
Could you provide a little more details, then I’ve maybe be able to help you.
February 8th, 2008 at 10:40
Thanks! Great tutorial. I usually use Texteditor with my Mac to do coding, but sometimes I have to use a Windows machine(don’t ask me why), and It was just driving me crazy.
March 11th, 2008 at 09:51
thank you.
April 8th, 2008 at 18:59
[...] I’ve written a tutorial on how to get TextMate like functionality in jEdit. You’ll want to go through this is if you use jEdit for [...]
April 13th, 2008 at 10:47
thank you very much
May 7th, 2008 at 00:46
thanx for all this.
December 15th, 2008 at 06:33
Here’s a question.. I was having trouble because I wanted to expand an abbreviation within another abbreviation. Say, type “h3″ to get “|” and then after typing some text expand “i” () within the h3. You can’t do this because the shortcut keys aren’t reactivated until you exit the abbreviation.
What I figured out is that when you have only a single variable in an abbreviation, such as “$1$end” it’s really better not to use the variable. If the abbreviation is instead “$end” then you exit the abbreviation immediately after it is expanded. And then you can enter and expand another abbreviation from within the first one.
January 25th, 2009 at 09:06
Nice tips! If you are intereseted in making your JEdit a little prettier I’ve written converter from Textmate’s colour scheme format to JEdit’s format. Please check my post at http://sickill.net/blog/2009/01/20/textmate-to-jedit-colour-theme-converter.html . You can grab there the converter and/or already converted 16 schemes.
April 6th, 2009 at 18:57
Regarding to the “Notes”, I would like to add a few abbreviation to a new “mode”, namely .erb or .html.erb. How do I create that mode?
If I create a file with the extension, say .uuu then all abbreviations I create in this file go to Global.
So I actually miss the Create and Delete mode function from the SuperAbbrevs plugin (I know, I know, I’m greedy :-)
April 6th, 2009 at 20:41
Probably have to create this new mode in jedit’s modes itself, not superabbrevs.
I usually just put all my abbrevs in global. I mainly only work in html/js/ruby/java/css though.
April 7th, 2009 at 02:36
Thanks for the fast answer!
September 14th, 2009 at 23:43
Great post man! I really like Textmate-like editors such as JEdit and Gedit in Linux. Programmer editors when you know how to use them , are faaaar better than IDE’s. Thx.
June 19th, 2010 at 15:40
Thanks for this howto!
I could not find any documentation what syntax the variables should follow. Only your post made me try $1 and ${2:name_var} styles (like in eclipse) and it worked.
This (in combination with the GroovyScriptingPlugin) is one of the last bricks for building the bridge from eclipse to jedit.
Regards, Udo