//
you're reading...
Emacs

Swapping in Emacs


Here are some very useful tips for Emacs, regarding swapping.

SWAP WORDS:
If you have a text like the following and you want to change the order of the parameters for the foo function:

foo(First, Second) ->;
ok.

Just put the cursor on the comma or on the space between First and Second and press:
M-t

You will get the following:

foo(Second, First) ->;
ok.

SWAP LINES:
Start from:
First Line
Second Line

Put the cursor at the beginning of the second line and press:
C-x C-t

You will get:

Second Line
First Line

Easy, right? :)

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: