Suggestion/question: User-friendly tab auto-completions
Show older comments
Hello, I have a question/suggestion about the tab-to-complete box, and improving its utility. I am submitting this here, as there may be an existing option I am missing: otherwise I shall resubmit to feature requests.
The crux of the matter is that when using tab-to-complete in the command window, the alphabetical listing is actually a major hindrance if my script/function/variable name is similar to a lot of others in the Matlab path. If I have a variable 'plottedData' in my workspace, and I type 'plo-[TAB]' the list is enormous, and most of the words say plot in them; there is also no quick way to visually pick my variable out from all of the m-files (the '.m' at the end is not sufficient). Now I could continue typing my variable name, but that quickly makes auto-complete less useful. As someone who likes verbose function and variable names, AC is a real time saver.
So, the solution would be to allow re-ordering or sectioning of auto-complete suggestions. Say, workspace variables at the top in a block, functions in your custom matlab path in a second block, and functions in the default path at the bottom. (Note that there is an inherent issue with overloaded function names too, so maybe order those in the order they appear in the path list? Not sure, those are more complicated. and how about variable+function overloads?).
Alternatively, color coding variables vs. functions within the auto-complete window would make it easier to pick out.
I am certain that not everyone will want to muck with their AC the same way I do, but it would be nice to have the option. Does it exist?
8 Comments
Guillaume
on 28 Jun 2018
In my opinion, the best ordering would be by most recently used.
D. Plotnick
on 28 Jun 2018
Walter Roberson
on 28 Jun 2018
I'm sure someone posted about this same concern within the last two weeks but I cannot seem to locate the posting at the moment.
D. Plotnick
on 28 Jun 2018
Edited: Walter Roberson
on 28 Jun 2018
Walter Roberson
on 28 Jun 2018
Official documentation of that aspect is at https://www.mathworks.com/help/matlab/matlab_prog/customize-code-suggestions-and-completions.html -- but that does not affect which order the completions are offered between competing functions.
D. Plotnick
on 28 Jun 2018
Walter Roberson
on 28 Jun 2018
Ah, found it; it was from a month ago; https://www.mathworks.com/matlabcentral/answers/402787-how-do-i-suggest-to-matlab-that-i-prefer-to-edit-files-in-the-current-directory
D. Plotnick
on 28 Jun 2018
Accepted Answer
More Answers (0)
Categories
Find more on Entering Commands in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!