Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto indent all code without ctrl+A in MATLAB

One can auto indent all code in a .m file by typing ctrl+A followed by ctrl+I. However, this requires selecting all code which in my MATLAB IDE (R2011a, Linux, with Windows Shortcuts) moves the cursor to the end of the .m file. I then have to scroll back to where I was working.

Is there a way to autoindent an entire .m file without moving the cursor to the end of the file?

like image 605
chessofnerd Avatar asked Dec 03 '25 09:12

chessofnerd


1 Answers

Many modern IDEs and text editors, including MATLAB, support the keyboard shortcut of Ctrl+g for the "Go to line #" command.

I would therefore suggest simply remembering the line number you were on, and just coming back to it using the aforementioned shortcut after applying the indent the way you described.

like image 187
Dev-iL Avatar answered Dec 04 '25 23:12

Dev-iL



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!