MATLAB Answers

Column/multi selection mode

209 views (last 30 days)
Matthew Lang
Matthew Lang on 2 Mar 2012
Commented: Snoopy on 12 Aug 2021
Is there a way in the Matlab editor to select vertical selections of text (like Alt-selection in MS word or Notepad++) and to insert text or an incremented numbered list into a vertical selection? (Notepad++ has this by pressing Alt-C, but can only increment)
  1 Comment
James Johns
James Johns on 18 Oct 2017
Dear MathWorks, please implement this functionality. A "Column Mode" in Editor would be fantastic. Also, a "Column Mode" where you can increment numbers would save time as well. In 2017, we still have to open UltraEdit and Excel to do this and paste results in MATLAB.

Sign in to comment.

Answers (6)

per isakson
per isakson on 2 Mar 2012
No, but I agree it would be useful!
Every other day I copy blocks of code to Notepad++ to use "vertical selection" and regular expressions.

Amy
Amy on 28 Nov 2018
Hi all -- column selection mode, or block edit mode, was added to the Live Editor in R2018a, and there are plans to include the feature in the regular editor in a future release as well. You can select and edit a rectangular area of code by pressing the Alt key while making a selection with the mouse. This is mentioned briefly in the release notes for R2018a and also in the documentation page for creating a live script. Please go ahead and try it out!!
  3 Comments
Bandar
Bandar on 16 Dec 2019
2019, we still have no such feature. Any update?

Sign in to comment.


Bryan Munro
Bryan Munro on 26 Jan 2018
I'll second this, it's hard to overestimate how much time this feature would save me on a daily basis!

Ivan
Ivan on 30 Oct 2020
Edited: Ivan on 30 Oct 2020
also was looking for multi line selection, have made this function to open file in notepad++.
Can be used to fast open in any editor, good to assign it to some keyboard shortcut
function edit_in_npp()
% the function will open active in editor file in npp in the corresponding line
% before use check that npp is in your system path or set path to npp_path
% variable below.
% to set path from cmd use setenv('PATH', [getenv('PATH') ';C:\Program Files (x86)\Notepad++']);
npp_path='notepad++.exe'; % or set npp_path=C:\Program Files (x86)\Notepad++\notepad++.exe
doc=matlab.desktop.editor.getActive;
system(sprintf('"%s" "%s" -n%d',npp_path,doc.Filename,doc.Selection(1)));
  1 Comment
Peter Scotson
Peter Scotson on 30 Mar 2021
Very good! Suggest adding an ampersand to the sprintf('... &'). I needed to use the full path to notepad++

Sign in to comment.


Richard Yau
Richard Yau on 8 Nov 2018
Mathworks really needs this column edit feature in their editor. There's no reason not to have it and I end up having to temporarily open another editor just to edit something and going back to matlab editor afterwards. Why is this not already available????

Walter Roberson
Walter Roberson on 26 Jan 2018
I see no evidence that Mathworks will be making any feature changes to the regular editor, other than in the sense of continuing to work on the code analyzer and autofixes. Otherwise all of the editor development appears to be going into the live editor. Thus I do not expect the column cut or paste to ever be put into the regular editor. I would instead suspect that the live editor is intended to replace the regular editor in time.
  7 Comments
Snoopy
Snoopy on 12 Aug 2021
It works. Thank you.

Sign in to comment.

Categories

Community Treasure Hunt

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

Start Hunting!