Of course, any LaTeX editor will autocomplete common LaTeX commands and environments. Many (most?) let user add new commands to be autocompleted. However, in technical documents there will usually be specific terms, which are encountered often enough (and may be quite long) to be worth autocompleting, but aren't commands and are different from one document to another. So it's quite nice to be able to autocomplete any word which exists in the document (or any of the open documents).
I know Emacs, Vim, Kile and TeXstudio support this; do any others?
Best Answer
Any LaTeX editor can accommodate this style of auto-completion by means of macro definitions. It is probably the fastest way to perform this without having to switch from your existing editor to a new/different one. In my opinion, it is flexible, transferable and accommodates a host of variability that you may require based on (say) conditional support from LaTeX packages.
Since the replacement text is typically used inside regular text, the
xspace
package is of great help. It inserts a space after a command sequence only if it is followed by a space. This is a common issue with using command sequences in regular text. For example,A \TeX command sequence.
will expand toA TeXcommand sequence.
since the space represents the end of\TeX
and is therefore gobbled.xspace
is the way around this:If you change your mind (to quote ABBA), you can just change the macro definition. It would probably be the same amount of effort to do this than it would to modify the auto-completion segment provided by such an editor.
To go one step further, you can even define your macros to have (say) starred version
*
which expand to the plural form if use, otherwise it uses the singular form:The
xparse
package provides an easy interface for working with starred versions of commands/environments.