[Courses] Style (was Lesson Three: Basic Declarations &
Expressions)
Jenn Vesperman
jenn at anthill.echidna.id.au
Sun Oct 13 09:39:56 EST 2002
On Sun, 2002-10-13 at 07:24, Akkana wrote:
> Jenn is absolutely right, and here's another reason why: if you ever
> end up collaborating with other programmers
Thank you, and yes, you're right too. Especially about the tabs/spaces
thing.
I recommend using spaces rather than tabs, because when you cut and
paste you get spaces. And -everyone- cuts and pastes sometime.
> Oh, one other useful thing: if you want to enforce a spacing for a
> particular source file, you can specify the style in an emacs modeline
> at the top of the file: for example,
> /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
> Emacs will pick this up and use it in its C code formatter, so any new
> code you type in c-mode or c++-mode automatically gets indented to the
> right level. Is there a way to get vim to read these modelines?
I don't know about those modelines, but vim does use an equivalent. I
can't think what it is offhand, unfortunately.
Jenn V.
--
"Do you ever wonder if there's a whole section of geek culture
you miss out on by being a geek?" - Dancer.
jenn at anthill.echidna.id.au http://anthill.echidna.id.au/~jenn/
More information about the Courses
mailing list