Emacs blocks

Even though I've grown to love vim, I'm still an emacs fan. The advantage is that I can now use both equally fluently :-)

One thing I've always found vim to be superior for is inserting blocks of text. No more, for I have learned how to do this in Emacs as well *insert maniacal cackle here*

Select an area in the usual way : press Ctrl-Space to mark the starting point, then navigate to the endpoint (via the arrow keys or Ctrl-n, Ctrl-p, Ctrl-f, Ctrl-b, and the various Meta-key combinations). Once you're satisfied, press Ctrl-x r t and type the text you want to enter into the block, followed by an Enter.

If you've selected one or more columns, the text will replace your selection.

If you haven't selected any columns, the text will simply be inserted.

Another trick (for quickly commenting out several lines of code) is selecting the lines you want to comment, and use

M-x comment-region

w00t!
General 0 comments
This item is closed, it's not possible to add new comments to it or to vote on it