MATLAB Community

MATLAB, community & more

Tab to narrow completions

Tab completion is a great time saver for me, and helps me find a function when I can’t quite remember the exact name. There’s a little known feature that makes tab completion even more useful, though, and it happens to be off by default.

When you press tab in the Editor or Command Window, if there are functions that start with what you’ve typed, you’ll be shown a popup with a list of all the those functions. If you press tab again, then the selected item is inserted at the caret. But what if the popup is showing, and you want to filter down the list of things by typing more text? You can do that if you turn on the following preference:

Preferences -> Keyboard -> Tab key narrows completions (in the Tab Completion section)

When you press “p” at the command prompt, and then press tab, you’ll see a list of all the functions that start with “p”. So far, nothing is different.

But now, if you type “e” after the “p”, and then press tab, the list of items will be re-filtered, and you’ll see only items starting with “pe” .

Typing “a” with another tab really filters the list down into something usable.

You’ll have to press enter to accept completions now (instead of tab), which is an acceptable trade-off for me.

What do you think? Should this feature be on by default?

  • print
  • send email


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.