in gedit it's possible to define so-called "snippets" for simpler input.
For example, there is a snippet while
. This means: If you type while ->
(->
stands for tab key). And gedit automatically converts it to the following (including correct indentation):
while (condition){
}
In vim (in conjunction with latex-suite) I saw the following: If you type (, vim inserts just a (
. If you type ( a second time, vim automatically converts it to \left( \right)
.
I found abbrev-mode
but this mode doesn't place the cursor properly (i.e. between parentheses or inside the while loop).
I managed to create custom emacs keybindings/macros that do just the same (without having to press the tab key), so I know it's possible.
However, is there already and package where you can define such "snippets" without much effort? Or are there even any serious reasons not to use such things?