Coding Style
|
Please Participate! This article has been marked as incomplete. Please help us by expanding it. |
This is a general document about coding style on Creative Commons developer projects. This is created to not create a holy war of style discussion, but to list basic settings and style recommendations for working on projects with Creative Commons.
Contents |
Spaces vs. Tabs
We encourage the use of 4 spaces rather than tab indention.
Settings
VIM
Set the following in your vimrc global file (usually at /etc/vim/vimrc or local ~/.vimrc file to get vim to work well with this style:
set expandtab "set tabs to expand spaces automatically set tabstop=4 " command :retab fixes all tabs to spaces set shiftwidth=4 " autoindents 4 spaces if autoindent turned on
Emacs
In your ~/.emacs, place these in your custom-set-variables section:
(custom-set-variables '(standard-indent 4) '(tab-stop-list nil) '(tab-width 4))
Modelines
We encourage not using modelines.
Settings
VIM
Set no modelines like this:
set nomodeline
External Links
Categories: Developer | Coding | Style | Incomplete
