View previous topic :: View next topic |
Author |
Message |
Highlands Guru
Joined: 22 Apr 2003 Posts: 366 Location: Sundsvall, Sweden
|
Posted: Sun Oct 23, 2005 10:12 pm Post subject: Emacs and indent |
|
|
I've installed emacs-cvs and now when i code C++ code the indent-mode wants code like this.
[code]
if (a == b) {
a = b;
}else{
b = a;
}
[/code]
but i want
[code]
if (a == b)
{
a = b;
}
else
{
b = a;
}
[/code]
How can i change this? |
|
Back to top |
|
|
allucid Veteran
Joined: 02 Nov 2002 Posts: 1314 Location: atlanta
|
Posted: Mon Oct 24, 2005 2:10 am Post subject: |
|
|
fix your code blocks and then we'll talk.
In the meantime, here are some settings you might be interested that go in in your ~/.emacs or ~/.emacs.el:
Code: | (setq-default indent-tabs-mode nil) ;; spaces instead of tabs
(setq default-tab-width 4) ;; tab width
(setq c-basic-offset 4) ;; C indentation offset
(setq c-default-style "gnu") ;; indentation style
|
fudge with the values until you get what you want. This may also help. |
|
Back to top |
|
|
|