Re: RFC: coding standards document

From: Date: Tue, 05 Dec 2000 21:28:30 +0000
Subject: Re: RFC: coding standards document
References: 1  Groups: php.pear 
Request: Send a blank email to php-pear+get-561@lists.php.net to get a copy of this message
On Tue, 5 Dec 2000, Jon Parise wrote: > On Tue, Dec 05, 2000 at 11:35:18AM -0500, Chuck Hagenbuch wrote: > > > ------------- > > [1] Indenting > > ============= > > > > Use an indent of 4 spaces, with no tabs. If you use Emacs to edit PEAR > > code, you should set indent-tabs-mode to nil. Here is an example mode > > hook that will set up Emacs according to these guidelines (you will > > need to ensure that it is called when you are editing php files): > > > > (defun php-mode-hook () > > (setq tab-width 4 > > c-basic-offset 4 > > c-hanging-comment-ender-p nil > > indent-tabs-mode nil)) > > Here are the vim rules that I use: > > set expandtab > set shiftwidth=4 > set tabstop=4 Here are a few hints for people contributing to multiple projects. Vim lets you easily define settings on a per-project base. I.e.: # defaults set shiftwidth=4 set tabstop=4 let smcd = "au BufRead,BufNewFile /home/sas/src" # exe takes the concatenated string and evaluates it exe smcd."/apache-2.0/* :set expandtab" exe smcd."/foo* :set expandtab" exe smcd."/foo* :set tabstop=2" exe smcd."/foo* :set shiftwidth=2" exe smdc:"/php4/pear :set expandtab" - Sascha

« previous php.pear (#561) next »