I don't quite have full completion, but I do wrap Mathematica in GNU rlwrap
. I know that you can teach rlwrap
a list of keywords to autocomplete, and even program it to determine what completions to suggest from your context. At the very least, you get history and line editing out of it.
My recipe:
- I used MacPorts to install
rlwrap
, and their port seems to work fine. - Create a list of Mathematica definitions that you care about and put it in
~/mathdefs.txt
. - Then I added
alias math='rlwrap -r -f ~/mathdefs.txt /Applications/Mathematica\ Home\ EditionMathematica.app/Contents/MacOS/MathKernel'
to my login script.- Obviously,The
-r
tells it might live in a different place ifto remember words that it sees you usetype during a different edition of Mathematica than I dosession, and the-f ~/mathdefs.txt
seeds its completion support with the words that you put in that file.
- Obviously,The
I notice that Wolfram has added their own history/editing support (probably using readline) in 10.1 at least. Quite possibly before then. I'm sure it wasn't there in 8.0, and I don't think it was in 9.0, but I'm not positive.