MATLAB Community

MATLAB, community & more

Scroll less with Editor Bookmarks

When I am working on code, I find that I often need to move back and forth between two places in the code – sometimes several places in the code. The best way to do this in MATLAB is with Bookmarks in the Editor. To add a bookmark in a file, place your caret on the line that you wish to mark, and then select the Go menu, Set/Clear Bookmark menuitem:

set bookmark

You can also use the Ctrl-F2 (On the Mac, Command-F2) keybinding to set a bookmark instead of using the menuitem.

A blue bookmark will be added to the gutter next to the line numbers:

set bookmark

Now you can easily move between bookmarks using the F2 key to move to the next bookmark and the Shift-F2 to go back to the previous bookmark, no matter where you are in the file.

  • print


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