# Tag Info

## Hot answers tagged autocomplete

48

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

21

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 ... 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 took some digging but at least in Version 7 the FrontEnd command is FT, e.g.: FEFT["Plot"] You can read the definition with Definition[FEFT]. 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"],$NewMessage[...

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 FEFC. It's been around for a while (here's a Mathematica Journal article that references it, near the end) although it has changed ...

15

(Posting my comment as an answer, per @murphy's suggestion) Please check the folder $UserBaseDirectory/SystemFiles/FrontEnd/SystemResources/Functional‌​Frequency and see if there are any unusually large files there (>100 Kb or so). If any such files exist, please delete them. The file CodeAssistHistory10.3.m is often the culprit, and is safe to delete. 13 Thanks for asking this question; I might not have discovered this customizable area without it. The auto-completion option values are automatically loaded on Front End start from: FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "SystemResources", "FunctionalFrequency", "OptionValues"}] This directory contains a series of Package (.m) ...

13

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

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

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

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

11

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"}] ... 11 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 ... 11 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, ... 8 No, I don't think it's possible. The reason is that built-in symbols are plagued by the same problem. I would actually consider this a bug. It's confusing and hinders usability. Plus, other operators, such as ->, are not turned into patterns. 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 ... 7 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, ... 7 You have to define its ::usage f1[a_, b_, c_] := Module[{}, Print[a];] f1::usage = "f1[a,b,c] prints the first argument"; Note that what you write at the beginning at the message (in this case f1[a, b, c] ) will determine the completion behavior, which is not defined by the function definition. Start a new line inside the string to have multiple ... 6 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 -&... 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", "... 5 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 ... 5 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

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

3

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

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.

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

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

3

This is sort of what the Private context is meant to be doing for you. You write that you just need more contexts that can behave like Private context for organizational purposes, and this can be achieved using subcontexts that use a Private mark. My normal instinct would be to put the helper functions to MainFunction inside a Private` branch of ...

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

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