Skip to main content
Be more explicit. More links and hints.
Source Link
Marco Wahl
  • 2.9k
  • 16
  • 16

UseYou can use a keyboard macro. Generally using a keyboard macro means to record some steps for later reuse. (F3Find documentation about keyboard macros within Emacs by entering C-h F kmacro-start-macro-or-insert-counter <RET>.)

Recent versions of Emacs provide the function key <F3> to start a recording of a keyboard macro and F4 mean<F4> to finalize the function keys onrecording and also replay the keyboardlast recording (if not currently recording.)

To solve you question using a keyboard macro perform the following steps.

  1. Move the cursor to the beginning of the line with the 8000 characters.

  2. Act once and record asPress <F3> (to start macro: recording.)

  3. Perform the action. In this case e.g. move forward eight characters (press the left arrow key eight times) and press the enter key.

  4. Press F3 C-u 8 C-f RET F4<F4> (to finalize the macro recording. The macro then is recorded.)

  5. Play itType M-999 <F4>. Concretely this (typically) means: hold down the Alt key, press the 9-key three times, release the Alt key, press <F4>. Explanation: This plays the macro 999 times:. Recall that C<F4> replays the previously recorded macro. One can further specify a number how often the macro will be replayed (see the Emacs documentation for "Arguments"). The M-u 999 F4 stands for 999 repetitions.

  6. Be patient while the macro performs.

  7. VoilaSee the result of the transformation!

Use a keyboard macro. (F3 and F4 mean the function keys on the keyboard.)

  1. Move cursor to the beginning of the line.

  2. Act once and record as macro: F3 C-u 8 C-f RET F4.

  3. Play it 999 times: C-u 999 F4.

  4. Be patient.

  5. Voila!

You can use a keyboard macro. Generally using a keyboard macro means to record some steps for later reuse. (Find documentation about keyboard macros within Emacs by entering C-h F kmacro-start-macro-or-insert-counter <RET>.)

Recent versions of Emacs provide the function key <F3> to start a recording of a keyboard macro and <F4> to finalize the recording and also replay the last recording (if not currently recording.)

To solve you question using a keyboard macro perform the following steps.

  1. Move the cursor to the beginning of the line with the 8000 characters.

  2. Press <F3> (to start macro recording.)

  3. Perform the action. In this case e.g. move forward eight characters (press the left arrow key eight times) and press the enter key.

  4. Press <F4> (to finalize the macro recording. The macro then is recorded.)

  5. Type M-999 <F4>. Concretely this (typically) means: hold down the Alt key, press the 9-key three times, release the Alt key, press <F4>. Explanation: This plays the macro 999 times. Recall that <F4> replays the previously recorded macro. One can further specify a number how often the macro will be replayed (see the Emacs documentation for "Arguments"). The M-999 stands for 999 repetitions.

  6. Be patient while the macro performs.

  7. See the result of the transformation!

Source Link
Marco Wahl
  • 2.9k
  • 16
  • 16

Use a keyboard macro. (F3 and F4 mean the function keys on the keyboard.)

  1. Move cursor to the beginning of the line.

  2. Act once and record as macro: F3 C-u 8 C-f RET F4.

  3. Play it 999 times: C-u 999 F4.

  4. Be patient.

  5. Voila!