TypeSaver Plugin |
By Valery Kondakoff
strauss@orc.ru |
General Information
Change Log
To Do
General Information
The TypeSaver Plugin is simple and useful (I hope) tool to
save you from unnecessary typing. It consists of two main functions:
"Line comment-uncomment" is a replacement for internal jEdit function
"Block comment".
"Predefined abbreviation expansion" is a replacement for internal
jEdit "Expand Abbreviation" function (available since jEdit-2.3pre1)
Note, that if you use older jEdit version (before jEdit-2.3pre1),
you need to use older TypeSaver version 1.1.1!
Line comment-uncomment
Plugins>TypeSaver>TS: Line comment-uncomment
This function acts like jEdit "Block Comment". It places
comment at the start of each full or partially
selected line. If the entire line was previously commented,
applying this function again will uncomment it. Note:
comments in the middle of the line are not added/removed.
The string used for block commenting can be changed using
buffer-local properties (:blockComment=xxx:)
If you want to use "Line comment-uncomment" instead of "Block
comment" just redefine the default keyboard shortcut (C+e C+k)
from "Block comment" to "TS: Line comment-uncomment".
Predefined abbreviation expansion
Plugins>TypeSaver>TS: Complete predefined abbreviation
This is my first attempt to "merge" TypeSaver expand abbreviation
functionality with jEdit internal "Expand Abbreviation" function.
Instead of maintaining it's own abbreviation set TypeSaver now uses
jEdit built-in abbreviations.
What do you need to do to make TypeSaver work?
Just assign different keyboard shortcut to "TS: complete predefined
abbreviation" command. (<C+e C+s> or <ESCAPE> for example).
When you want to add or change some abbreviations - just go to
Utilities>Global Options>Abbreviations and change
abbreviations in the list.
If you want you can use both abbreviation expansion methods
simultaneously (TS and jEdit-internal).
What new functionality is added compared to jEdit internal "Expand
Abbreviation" function:
- Setting cursor position using "|" symbol
- Creating complex multiline abbreviations using "\n" and "\t" symbols
- Autoindentation of expanded abbreviations
- You can set your abbreviations to "autoclose" various
delimiters ('{', '(', '<', '[', ''' or '"').
What functionality is missed:
- Auto-expanding of abbreviations. Maybe I'm wrong, but I think this
feature (in current implementation) just make the work with abbreviations
more difficult
There is a list of enhanced Java abbreviations, inherited from older
TypeSaver versions. If you want to use them, exit jEdit and copy and
paste abbreviations in [java] section of "abbrevs" file, that is located
in jEdit user settings directory ($HOME/.jedit).
"|"|"
'|'|'
(|();
/|/* | */
<|<|>
[|\[|\]
Psf|public static final
Psfb|public static final boolean
Psfi|public static final int
Psfs|public static final String
ab|abstract
bo|boolean
br|break
ca|catch (|) {\\n\\n}
cl|class
cn|continue
db|double
de|default
do|do {\\n|\\n} while () {\\n\\n}
doc|/**\\n * |\\n*/
el|else
ex|extends
fa|false
fi|final
fl|float
for|for (|;;) {\\n\\n}
fy|finally
ie|interface
if|if (|) {\\n\\n}
im|implements
impa|import java.awt.
impj|import java.
imps|import javax.swing.
impu|import java.util.
iof|instanceof
ir|import
main|public static void main(String[] args) {\\n\\n|\\n}
pe|protected
pr|private
psf|private static final
psfb|private static final boolean
psfi|private static final int
psfs|private static final String
pst|printStackTrace();
pu|public
re|return
sh|short
st|static
sw|switch (|) {\\n\\n}
sy|synchronized
tds|Thread.dumpStack();
th|throws
tr|transient
try|try {\\n|\\n} catch () {\\n\\n}
tw|throw
twn|throw new
vo|void
wh|while (|) {\\n\\n}
{|{\\n|\\n}
Change Log
Version 2.1.3
- TS uses Swing document positions instead of markers.
- Code simplified
Version 2.1.2
- Fixed incompatibility with jEdit-2.5pre2.
Version 2.1.1
- Fixed incompatibility with jEdit-2.4preXXX. (Thanks to Kristian Ovaska)
Version 2.1.0
- Auto-adding of undefined abbreviations is implemented.
Version 2.0.0
- This is my first attempt to "merge" TypeSaver and jEdit internal
Expand Abbreviations" functionality.
Version 1.1
- Most of "Predefined abbreviation expansion" was completely rewrited
(Thanks to Kristian Ovaska for ideas and programming!). TS version 1.1
gives user a possibility to have additional indentation contol using
whitespaces and tabs. This may be useful when creating abbreviatiuons
like this one: "/**\n * |\n * \n*/".
- Fixed incompatibility with jEdit 2.2final (since Slava removed
GUIUtilities.loadImageIcon() method from jEdit core)
- There are some additions to default set of predefined abbreviations.
Version 1.0
- You can construct multiline abbreviations using "\n"
- You can specify cursor position using "|" symbol
- "Delimiters autoclosing" now can be "finetuned" from an OptionPane
- There is enhanced set of default predefined abbreviations that comes
with TypeSaver. Note, that if you are upgrading from pre 1.0 TypeSaver
version you will need to delete "typesaver.properties" file from jEdit
user settings directory ($HOME/.jedit) to reset abbreviations to their
default values.
Version 0.6
- '<', ''' and '"' are added to "Predefined abbreviation expansion"
delimiters list
- Various bugs in "Predefined abbreviation expansion" are fixed
Version 0.5
- "Predefined abbreviation expansion" now is able to "autoclose"
open brackets
Version 0.4
- Enhanced RegExp in "Line comment-uncomment" (Thanks to Mike Dillon)
- Now users can use regexp metacharacters as comment symbols ("Line
comment-uncomment") (Thanks to Mike Dillon)
- Fixed "Predefined abbreviation expansion" incompatibility with Java 1.1
(Thanks to Kevin A. Burton)
- "Complete word" class removed from plugin, because Slava Pestov included
it into jEdit.
Version 0.3
- Added TypeSaver Tab in "Plugin Options"
- Users can now modify contents of abbreviations list from "Plugin Options"
Version 0.2
- Added Line comment-uncomment
- Added Word completion
Version 0.1
To Do
- Any ideas for enhancement? :)