unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Shift regions.
Date: Wed, 22 Oct 2008 00:53:46 -0700 (PDT)	[thread overview]
Message-ID: <4d3dedd0-05a3-4614-b469-8e990a9f1a03@y71g2000hsa.googlegroups.com> (raw)
In-Reply-To: 1224651514.962693@nntp.acecape.com

On Oct 21, 9:58 pm, Wei Weng <ww...@acedsl.com> 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
mode.

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.

  Xah
∑ http://xahlee.org/

  reply	other threads:[~2008-10-22  7:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-22  4:58 Shift regions Wei Weng
2008-10-22  7:53 ` Xah [this message]
2008-10-22  8:39 ` Jan Seeger
2008-10-22  8:40 ` Jan Seeger
2008-10-22  8:49 ` Jan Seeger
2008-10-22 10:17 ` Bernardo Bacic
2008-10-22 12:46 ` Parker, Matthew

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d3dedd0-05a3-4614-b469-8e990a9f1a03@y71g2000hsa.googlegroups.com \
    --to=xahlee@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).