Skip to content

Instantly share code, notes, and snippets.

@myegorov
myegorov / 002-append-in-single-step.md
Created March 19, 2019 06:00
edit start-middle-end of line

Editing at line start - middle - end

We frequently need to edit the beginning or end of a line. The text may also be arranged in columns. We can then resort to keyboard macros, but there's a less laborious approach.

Suppose we're editing this excerpt:

foo = 1
@myegorov
myegorov / 001-repeat-last-change.md
Created March 19, 2019 05:57
repeat an arbitrary sequence of edits in emacs a la vim's dot command

Repeat one or more commands in sequence

Emacs C-x z can be used to repeat a single command. To emulate Vim's dot command (.), use keyboard macros.

A typical workflow:

  • C-x ( to start recording a macro, C-x ) to end the recording.
  • execute the last recorded macro with C-x e (repeat with e);