16
$\begingroup$

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.

$\endgroup$
5
  • 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, 2012 at 13:45
  • $\begingroup$ The above screenshot is for MMA 8.0 under Mac OS 10.7.4. $\endgroup$
    – Helium
    Oct 24, 2012 at 17:26
  • $\begingroup$ It's 8.0.1.0, Mac OS X x86(32-bit, 64-bit Kernel). $\endgroup$
    – Helium
    Oct 24, 2012 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, 2012 at 6:10
  • $\begingroup$ Related: mathematica.stackexchange.com/questions/16599/… $\endgroup$ Dec 21, 2012 at 0:17

1 Answer 1

10
$\begingroup$

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:

$\endgroup$
2
  • 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, 2014 at 21:59
  • $\begingroup$ @Nasser: Yes, that's annoying (though I bet some IDEs play that way too). $\endgroup$
    – orome
    Nov 19, 2014 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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