MATLAB Answers

Possible to open file by text, go to file, quick open, quick search

조회 수: 8(최근 30일)
Chris Anderson
Chris Anderson 2016년 11월 2일
답변: Josh Philipson 2020년 5월 19일
Visual Studio Code, Atom, BBEdit all have the ability to type a keyboard shortcut that opens a "quick file search" text field. You type the first few letters of the file name like "myT" and it shows you all files in the file browser that begin with "myT" and lets you quickly select one. Does the MATLAB IDE have similar functionality?
You can think of the functionality as similar to the "Help Search" where you type in the name of a function and it lists suggestions you can quickly open in Help. I want this but with all of the filenames of my working directory indexed to quickly open a particular file. Clicking through the tree is terrible.

답변(2개)

Nick Counts
Nick Counts 2016년 11월 5일
편집: Nick Counts 2016년 11월 5일
Chris,
I am not 100% sure I know the behavior you are after, but I might have something for you that comes close. It is the 'Find Files' tool. While it doesn't update results instantly, it does let you do some pretty powerful file searching across the entire Matlab path (or any other set of folders).
It's especially useful for finding code that depends on one of your functions.
Also, if you have a script or function that is on the path, you can start typing the name in the command window and use tab complete. You can do the same thing with open (this doesn't always work).
I believe open grabs whichever file which returns, so if you have overloaded file/function names, it doesn't work as well.
Hopefully there's something useful in there
<<
>>

Josh Philipson
Josh Philipson 2020년 5월 19일
I believe the idea here is that you have an array of files open in your editor - and you know the name (or part of the name) of the file that you want to jump to - and you want a pop-up that will allow you to search and jump to that file.
That'd qualify as a quick-jump file-edit, IMO. Sort of like PyCharm's quick-jump capabilities (which are enviable, to be sure!)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by