in gedit, you can define so-called "fragments" for easier input.
For example, there is a fragment while. This means: If you type while ->( ->means tab). And gedit will automatically convert it to the following (including proper indentation):
while (condition){
}
In vim (combined with the latex package), I saw the following: if you type (, vim only inserts a (. If you type a (second time, vim will automatically convert it to \left( \right).
I found abbrev-mode, but this mode does not position the cursor properly (i.e. between parentheses or inside a while loop).
I managed to create custom emacs keyboard shortcuts / macros that do the same thing (without pressing the tab keys), so I know that this is possible.
However, is there already a package where you can define such "fragments" without much effort? Or are there even serious reasons not to use such things?
source
share