Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in Emacs, edit multiple lines at once

Tags:

emacs

I believe textmate has a mode where if you start typing, the same thing will be entered on all the lines you've selected. Is there something similar to this in emacs? I'm guessing there's a way rectangles can help me, but I'm not sure how...

like image 362
allyourcode Avatar asked Apr 17 '09 18:04

allyourcode


People also ask

How do you edit multiple lines at once?

Select the lines you want and then press: Windows: Shift + Alt + i. Mac: shift + option + i.

How do I select multiple lines in Emacs?

This is shift-select-mode , and it is enabled by default in Emacs 24+. On some (non-chiclet) keyboards, you should be able to hold down C-S- with a single pinky.

How do I delete multiple lines in Emacs?

Move your cursor directly before the region you want to delete. Set a mark by pressing Ctrl-6 or Ctrl-^ . Move the cursor to the end of the region you want to delete and press Ctrl-k .


1 Answers

It's as simple as this: C-x r t

Some examples are here: http://ergoemacs.org/emacs/emacs_string-rectangle_ascii-art.html

like image 124
allyourcode Avatar answered Sep 22 '22 08:09

allyourcode