//
you're reading...
Emacs

Macros in Emacs


You can start recording a keyboard macro by typing:
C-x (

Do whatever you want and stop recording with:
C-x )

Then, you can select a region and type:
C-x C-k r

To apply the macro to the selected region.
Emacs Macros are a really powerful tool. Just think if you need to prepone/postpone a string to a group of lines, for example from:

First Line
Second Line
Third Line

To:

  • First Line
  • Second Line
  • Third Line
  • About these ads

    About Roberto Aloi

    Software Engineer and Erlanger. Author of www.tryerlang.org.

    Discussion

    No comments yet.

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s

    Follow

    Get every new post delivered to your Inbox.

    %d bloggers like this: