[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shift regions.

From: Xah
Subject: Re: Shift regions.
Date: Wed, 22 Oct 2008 00:53:46 -0700 (PDT)
User-agent: G2/1.0

On Oct 21, 9:58 pm, Wei Weng <address@hidden> wrote:
> Hi All.
> How do I shift a highlighted/marked region a tab to right/left?

perhaps the following is what u mean?

Q: How to add a prefix to every line? (such as # or //)

Mark (Ctrl+Space) the beginning of first line and move cursor to the
beginning of the last line, then do “Alt+x string-rectangle” (Ctrl+x r
t), then type what you want to insert. This command can be used to
insert a string across mulitple lines not just at their beginning
position, but any position in a block of lines.

Alternatively, you can select a region and do “Alt+;” to make the
region into a comment or uncomment block specific to your language's

Q: How to delete the first few n chars of every line?

Mark (Ctrl+Space) the beginning of first line and move cursor to the
last line, and move it to the right n chars. Then do “Alt+x kill-
rectangle” (Ctrl+x r k). This command can be used to delete any
rectangular block of text, not just at the beginning of lines.

There's also
indent-region and indent-rigidly.

I have some emacs tutorial on my website you might be interested.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]