# How to make the suggestion box appear?

When you type a function in Matlab, quickly a suggestion box comes up showing functions similar to the one you're typing. I thought that Mathematica didn't have this but one day, I typed half of a function and the went to the kitchen when I got back, the suggestion box was there. I'm not sure if it appears after some time or if I accidentaly pressed some key.

-
By default, you don't need to do anything in Mathematica 9: as soon as you begin typing a function name, a possible list of completions will pop up without your doing anything. And this "predictive interface" allegedly learns from which completions you use most often. –  murray Dec 21 '12 at 15:34

Do you mean CtrlShiftK?

After typing Plo, press the key combination CtrlShiftK and a window will appear with possible options:

As pointed by Yves，CtrlK will also work，but CtrlShiftK will work differently if you finish the function name. For an example,

1. Type Plot3D;
2. Use CtrlShiftK;

Mathematica will show:

-
...and it's quite useful since Mathematica functions average about 57 times more letters than Matlab's –  Rojo Jun 6 '12 at 5:09
This is perfect, and it was exactly the kind of thing I was searching for. I guess my hypothesis of accidentaly pressing the keys is fairly invalid now. I also remember that the box I saw was pretty different, an allucination maybe? –  Voyska Jun 6 '12 at 7:30
Perhaps we should employ infinite monkeys to get all of them funky shortcuts ;-) –  Yves Klett Jun 6 '12 at 9:06
+1 because I keep forgetting to use Ctrl+Shift+K! That could really improve my speed of entry. Now I just need to figure out how to make it give me ~infix~ ... :^) –  Mr.Wizard Jun 6 '12 at 9:52
And on the Mac it is Cmd+Shift+K. –  Mike Z. Jun 6 '12 at 10:02

Besides the nice real handy option suggested by @yulinlinyu (more here) you can also use text-based interface to find completion for your half-typed function. It is not that fast, but has its own advantages. Try executing this:

?Plot*


and you'll get this nice table of possible functions that complete your input. If you click on any you'll get short definition - as you can see below. And if you click on >> sign at the very end you'll get full Documentation Center article. Sometimes this is really handy, because you can take time clicking various definitions and do completion from other side:

?*Graph


This is how, for example, I discovered that Mathematica supports the awesome DeBruijnGraph (definition shown above). And of course you can generalize further:

-

Sometimes instead of handy shorthands like in the other answers, you'll find more useful Names giving a list of the names of symbols matching the string, (it's case sensitive of course) e.g.

Names["Gro*B*"]
Names["Gro*b*"]

{"GroebnerBasis", "GroupActionBase", "GroupPageBreakWithin"}

{"GroebnerBasis", "GroupMultiplicationTable", "GroupOrbits",
"GroupSetwiseStabilizer", "GroupStabilizer", "GroupStabilizerChain"}


If you want to look at the documentation of a given name :

1. highlight its name e.g GroupActionBase
2. then press F1

Names can be useful in many cases e.g. when you'd like to select only names with special Attributes, or to figure out how many specific symbols there are.

Select[Names["G*"], MemberQ[Attributes[#], NumericFunction] &]

{"Gamma", "GammaRegularized", "GegenbauerC", "Gudermannian"}


To count the number of names let's define :

f = Length @ Names @ # &;


e.g. in Mathematica 8

f /@ { "*G*", "Gr*", "Gra*", "Graph*", "*Graph*" }

{348, 99, 56, 52, 113}


in Mathematica 7 there were less of them

f /@ { "*G*", "Gr*", "Gra*", "Graph*", "*Graph*" }

{200, 64, 34, 30, 38}

-
Did you evaluate the last piece of code in Mathematica 7, or is there a way to tell Mathematica to pretend it is version 7? –  Michael Wijaya Jun 7 '12 at 13:00
That was evaluated in Mathematica 7 and 8 respectively. You can find e.g. New in 8.0: Alphabetical Listing : reference.wolfram.com/mathematica/guide/… so it is possible to count the new functions programmatically, although I found it more straightforward to evaluate f in the both versions separately. –  Artes Jun 7 '12 at 13:31