You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Bryan Pendleton <bp...@amberpoint.com> on 2005/11/23 05:30:35 UTC

Indentation and formatting question

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.

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


Re: Indentation and formatting question

Posted by Oy...@Sun.COM.
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/

Re: Indentation and formatting question

Posted by Mike Matrigali <mi...@sbcglobal.net>.
Here is the _vimrc I use on a 5.x version of vim. I agree that
it is best to just not put tabs into the code, and just use
spaces.

  Note that the
compile error stuff does not work any more.  I am not sure if it
was a new ant version or a new jvm version that broke it.  If anyone
has a good setting for the following 2 I would appreciate it:

makeprg
errorformat

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.
> 
> :filetype indent on
> :set softtabstop=4
> :set shiftwidth=4
> :set expandtab
> :set ic
> 
> 
>