Search code examples
matlabkeyboard-shortcuts

what's the shortcut for copying cursor's current line?


what's the shortcut for copying cursor's current line? In matlab's preference setting, I can't find it in the the shortcut key panel.


Solution

  • Just select the current line and press Ctrl+C.

    For selecting the line, press Home button to take the cursor to the beginning of line and then press Shift+End to select the line to its end. These steps work in multiple applications; not just MATLAB.

    A line can also be selected with triple mouse click on the line or clicking the space between the break-point gutter and the start of the line (cursor horizontally flips to inverted-cursor in this space).

    Relevant Mathworks blog: Selecting a whole line