db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oyvind.Bakk...@Sun.COM
Subject Re: Indentation and formatting question
Date Wed, 23 Nov 2005 12:18:53 GMT
Bryan Pendleton wrote:
> I'm having trouble getting my editor set up properly
> to work with the Derby source code.
> 
> Can somebody send me the commonly-accepted Derby source
> code tab-and-spacing conventions?
> 
> I'm using VIM, so ideally if somebody could point me at
> a .vimrc that set things up "the right way"...
> 
> thanks,
> 
> bryan
> 
> P.S. Here's what I currently use; it intentionally avoids
> putting hard tabs into the code because I've found they
> don't work as well as spaces.

I don't know much about VIM, but I completely agree with you on this - 
tabs are evil, since the width of a tab character is up to the 
presenting application, whereas a space is always a space.

The standard indentation width in Derby is 4 monospace characters. I use 
4 spaces in any new code I contribute. It doesn't always look nice mixed 
with the tab-indented lines if you just display a source file in a 
terminal window, but I don't think that's an issue. People write code in 
editors, and usually set up the editors to display a 4-character 
indentation for the tab characters.

> :filetype indent on
> :set softtabstop=4
> :set shiftwidth=4
> :set expandtab
> :set ic

-- 
Oyvind Bakksjo
Sun Microsystems, Database Technology Group
Trondheim, Norway
http://weblogs.java.net/blog/bakksjo/

Mime
View raw message