I wonder if it is possible to improve the front-end's autocomplete capability. Compared with some other more sophisticated editors/IDEs, such as eclipse, Mathematica's front-end does not provide a good autocomplete capability.

The front-end provides an autocomplete feature through (Control|Command)[+Shift]+K key bindings. But it has several different shortcomings. First off, the key binding is not the easiest one to use. I really prefer Control+Space or tab key combination which is used in many other editors rather than the Mathematica's unique Control+K. However, one can modify the key binding to his own choice.

Second, the function/variable name autocomplete feature, shows a list of options just over the line that you are typing rather than underneath the line. So, you cannot see what you have already typed in:

Mathematica's AC

Compare it with eclipse:

eclipse AC

Another nice feature of eclipse, that Mathematica supports a simpler version of through Control+Shift+K, is the parameter suggestion feature. Once you choose a function/class name from the above list, it shows you another list with all possible function/constructor parameters, which makes the life much more easier.

Parameter Completion

Eclipse even provides camel case notation:

Camel Case

Is that possible to modify the Mathematica's front-end to support such capabilities?

Note: Here is a list of Mathematica functions/options that might be useful: NotebookEventActions, NotebookSelection, CurrentValue, Names.

  • 1
    $\begingroup$ Under windows MMA 8.0.0, XPx64 I'm seing the dropdown list properly below what I'm typing. however, not in W7x64 MMA 8.0.4 $\endgroup$ – Rojo Oct 24 '12 at 13:45
  • $\begingroup$ The above screenshot is for MMA 8.0 under Mac OS 10.7.4. $\endgroup$ – Helium Oct 24 '12 at 17:26
  • $\begingroup$ It's, Mac OS X x86(32-bit, 64-bit Kernel). $\endgroup$ – Helium Oct 24 '12 at 17:44
  • 9
    $\begingroup$ The FE does completion by calling the kernel function FE``FC. Which is a very simple and naive function. Rewriting it could be the basis for an answer here. That having been said, this is radically revamped in v9 (coming soon!), and I wouldn't recommend any answer based upon this notion be applied to v9. $\endgroup$ – John Fultz Oct 25 '12 at 6:10
  • $\begingroup$ Related: mathematica.stackexchange.com/questions/16599/… $\endgroup$ – Mechanical snail Dec 21 '12 at 0:17

Since version 9, autocomplete behaves the way it does in modern IDEs,

enter image description here

including links to the documentation (the little document button), Tab to complete, and additional information available through a drop-down after completion:

enter image description here

See the following questions for information on writing templates for your own functions:

  • 1
    $\begingroup$ Since version 9, autocomplete behaves the way it does in modern IDEs except for one big shortcoming how-to-keep-the-ctrlshiftk-help-menu-remain-in-display-while-typing (and there is no answer to this as of version 10.01) $\endgroup$ – Nasser Nov 19 '14 at 21:59
  • $\begingroup$ @Nasser: Yes, that's annoying (though I bet some IDEs play that way too). $\endgroup$ – orome Nov 19 '14 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.