Select the first x letters of each row

Viewed 54

I have the following org doc

enter image description here

How could only select vertically the numer) part of each row

2 Answers

Emacs has a mean to manipulate arbitrary rectangles in the same way regions are manipulate.
You need first to select a rectangular region:

  • select a starting point with C-<Space>

  • go to the opposite point of the rectangular region

Then you can apply several 'rectangle' actions.
All these actions all prefixed with C-x r
Most useful are :

  • C-x r M-w copies a rectangular region and it is probably what you need

  • C-x r k Cut (kill)) a rectangular region

  • C-x r y will yank a copied rectangle at a given position.

Rectangle actions are available in every mode, but to facilitate rectangle manipulation, you can use C-x <Space>; It is a toggle that turns standard copy/cut/paste actions (M-w, C-w, C-y and so on), to apply on rectangles. You also have a visual feedback on the selected rectangle.

Rectangle mode is very handy to manipulate columns in a tabular display (for instance to permute two columns).

C-x r N (rectangle number lines) is also useful to insert an automatic numbering of lines and it may also solve your problem.

If you use evil, you can type C-v to enter visual mode and use j to select the row you want from top to down.

Related