Tag Info

Hot answers tagged

38

Preface With Mathematica version 9.0.1 the following answer not valid anymore because the underlying protocol between front end and kernel was changed. Fortunately, we started to implement an open-source Mathematica plugin for IntelliJIDEA which has a full support for camel-hump completion. Please see this post for more information Camel-humps ...


19

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, Type Plot3D; Use CtrlShiftK; Mathematica will show:


16

This is obsolete in Mathematica 9, which automatically includes contexts in completions. Undocumented function: use at your own risk, subject to change in future versions, etc.... The function you're interested in is FE`FC. It's been around for a while (here's a Mathematica Journal article that references it, near the end) although it has ...


15

There is an undocumented file in the installation directory named specialArgFunctions.tr: NotebookOpen @ FileNameJoin @ { $InstallationDirectory, "SystemFiles", "FrontEnd", "SystemResources" , "FunctionalFrequency", "specialArgFunctions.tr" } This file describes in detail how to attach completion actions to each parameter of listed functions. For ...


15

This took some digging but at least in Version 7 the FrontEnd command is FT, e.g.: FE`FT["Plot"] You can read the definition with Definition[FE`FT]. If you want only the Box form itself we can modify it accordingly (here for version 7): templateCell[name_String] := Module[{template}, If[! StringQ@ToExpression[name <> "::usage"], ...


13

Changing shortcuts isn't that complicated. All you have to do is change one line in the file KeyEventTranslations.tr in a location in your file system specified by this command: FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "TextResources", $OperatingSystem}] Locate the following line in a text editor and change the key into the one ...


13

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 ...


13

On my system, setting the following to False works (Mac OS X): (in Preferences->Advanced->"Open Option Inspector")


12

To clarify the situation: In Version 9 on Windows and OS X, there is a new Make Template system which supports multiple templates for built-in functions. As part of the new system, unfortunately a bug was introduced which makes it ignore the usage statement for user-defined functions. This bug has been confirmed and we hope to fix it in a future release, ...


9

In the meantime, I was playing around. This is just to add a hotkey (Alt+k in windows) to replace what you have written so far with the partial symbol found. I don't know if it is a useful thing if we don't add it a way to handle multiple findings. Put this in a "init.m" file, inside FileNameJoin[{$UserBaseDirectory, "Applications", "AutocompleteBonus"}] ...


7

You can also use hotstrings as a way of autocompletion. By using such replacements, words are immediately replaced by another word on typing a space after the hotstring: CreateDocument[{}, InputAutoReplacements -> {"sync" -> SynchronousInitialization}] You can set such replacements globally under Option Inspector (CtrlShiftO). Of course no one would ...


5

I also took a crack at this. I think I made it look pretty close to the jquery example you posted. Figuring out how to move the insertion point to the end of the word once a suggestion is selected was a bit of a struggle. As a result, there's a DynamicWrapper in there that may be unstable. Input is the list of possible values from which you'd like to draw ...


5

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", ...


4

Note: This appears to really slowly in M9, although it works well in M8. It probably is better to use teedr's until it can be figured out what is causing the slow speeds. The following seems to work pretty well. I wrapped the options in a Pane and Framed so the entire row is clickable. ClearAll[AutoInputField]; SetAttributes[AutoInputField, ...


4

Maybe overkill but it was educational to try: DynamicModule[{}, EventHandler[ Overlay[{ Dynamic@Framed[ Row[{Style[x, Transparent, 15, Bold], Style[rest, GrayLevel@.6, 15, Bold]}], ImageSize -> {280, 30}, Alignment -> Top, FrameMargins -> {{5, 0}, {0, 1}}], InputField[Dynamic@x, String, BaseStyle ...


3

You can try (for a single notebook) CreateDocument[{}, NotebookEventActions -> {{"KeyDown", "\t"} :> NotebookWrite[SelectedNotebook[], "\t"]}] or (for global application) SetOptions[$FrontEnd, FrontEndEventActions -> {{"KeyDown", "\t"} :> NotebookWrite[SelectedNotebook[], "\t"]}] Does this meet your needs? For me it had an effect in ...


3

My humble contribution: (* Use this function to style list elements *) listItemStyle[item_] := Mouseover[#, Style[#, Background -> LightBlue]] &@ MouseAppearance[Framed[item], "LinkHand"]; (* This filters the list of data and returns a clickable list *) SetAttributes[autoComplete, HoldFirst]; autoComplete[s_, data_] := If[ StringLength[s] > 0, ...


3

Use Remove aber = {1, 2, 3} Remove@aber


3

This has to do with the Notebook's default context setting in the evaluation menu. If it isn't set to Global`, the definitions made in init.m are not seen. As rm-rf says, a good way to put custom definitions in the init.m would be to use Begin and End to create an Init` context and append that context to the context path so that the definitions are ...


3

Partial solution for Linux (Ubuntu 12.04, GNOME 3.4.2) In version 8 I can expand it into a template the same way that normal expansion works. In version 9 this seems to work differently. You have to expand (or type) the full function name first and press then Ctrl+Shift+K xxyyzz::usage = "xxyyzz[x,y]"; Now I type xx press Ctrl+K and then Enter and I ...


3

This problem is fixed in the newest version of Mathematica 9.0.1 (at least for me). Notice: Wolfram published several versions with the name "9.0.1" for Linux and only the current one (md5 sum 7fcbc4d1488757b10ef07740ac30a580) fixed this bug.


2

seems like a bug and should be reported to support@wolfram.com. Noticed when I miss-spelled Plot and wrote PLot instead, the correct auto-completion came up. This tells me the context of another command before on the same line, which is Plot in this case, was confusing the Auto-complete for the next command on the same line. One temporary solution (not ...


2

Seems that you can work around this by modifying for example SyntaxInformation[Plot]={"ArgumentsPattern" -> {_, _, _}}, at the cost of having incorrect syntax highlighting. For some reason, setting SyntaxInformation[Plot]={"ArgumentsPattern" -> {_, {_,_,_}, __}} isn't sufficient to kill the Options[Plot] pattern matching, and I haven't found a form of ...


2

This is a V9 functionality. The closest you can get in V8 are the Ctrl+K (complete selection) and Ctrl+Alt+K (make template) shortcuts to these items in the Edit menu. They also work in V9.


1

Paraphrasing the insights of rm -rf: To make highlighting and autocompletion work in new contexts you have to run: 1) Begin[...]; 2) AppendTo[$ContextPath,...] and 3) End[]. Then you have to open your context again: Begin[...]; Be sure to put each of (1), (2) and (3) in the previous bullet point in separate cells. They have to be evaluated separately or it ...



Only top voted, non community-wiki answers of a minimum length are eligible