From: Alan Mackenzie <acm@muc.de>
Subject: Re: how to indent
Date: Tue, 14 Mar 2006 20:28:39 +0000 [thread overview]
Message-ID: <n197vd.7u.ln@acm.acm> (raw)
In-Reply-To: 1142337546.148613.304300@v46g2000cwv.googlegroups.com
billy <bp1497@att.com> wrote on 14 Mar 2006 03:59:06 -0800:
> My original source was built using vim with auto indent shut off. Now
> every line I enter new gets indented different that what I had. I had
> vim set for tab to be 2 spaces. How can I force the remainder of a
> file to indent to the standards of what emacs has as auto indenting. A
> pretty print ?
What sort of file is this? C, C++, perl, Fortran, Cobol, Python, ....?
It makes a difference to what you need to do.
However, if you're talking about C, try writing the following into your
.emacs[*]:
(setq c-basic-offset 2)
, which will set the indentation step to 2 characters. To re-indent the
whole file in one go (you're a braver man than I ;-), do C-x h (which
"marks" the whole buffer) and then C-M-\ (that's
"control-meta-backslash", where the "meta" key is (probably) your left
alt key).
[*] If you haven't got one, do "C-x C-f ~/.emacs" (that's
"control-x,control-x", followed by "~/.emacs"). Then you'll have one.
--
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").
prev parent reply other threads:[~2006-03-14 20:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-14 11:59 how to indent billy
2006-03-14 20:28 ` Alan Mackenzie [this message]
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=n197vd.7u.ln@acm.acm \
--to=acm@muc.de \
/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).