Emacs: Consecutive numbers / digits in a rectangle column / vertically

emacs vertical line numbering

In Emacs 24.1, there’s a command

  C-x r N (‘M-x rectangle-number-lines’)

for numbering lines.

Mark a vertical strip of 1 char wide rectangle, e.g. with
  C-SPC-arrowKeyDown
and press
  C-x r N
That's it.

If you want to start from another number than 1, e.g. 12, use the **C-u** prefix, e.g.

  C-u C-x r N 12 RET RET

Using the C-u prefix it is also possible to change the format of the numbers, e.g. to
01
02
03
04

blog_tags: 

Add new comment

Filtered HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <img> <br> <p> <span>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Use [collapse] and [/collapse] to create collapsible text blocks. [collapse collapsed] or [collapsed] will start with the block closed.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Code snippets in <code>...</code> or <source>...</source> automatically will be pretty printed.
  • Use [collapse] and [/collapse] to create collapsible text blocks. [collapse collapsed] or [collapsed] will start with the block closed.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Target Image