summaryrefslogtreecommitdiffstats
path: root/doc/coding/coding-style
blob: b3658ef8adeedda7dd66a86e3e57c9dfb058f625 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Some guidelines

-- 1. Leading Tabs, no spaces.
.vimrc:
set noexpandtab
set tabstop=<spaces to display per tab>
set autoindent

If you want to see leading/trailing spaces:
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /^\t*\zs \+\|\s\+\%#\@<!$/


-- 2. ALL_CAPS_VARIABLE_NAMES
Variable names should be in caps. You can use lowercase
in for statements, like "for i in $SOME_STUFF; do"
Some old scripts haven't been updated yet....


-- 3. "do", "then" ... on the same line
for i in x; do
if  [ xyz ]; then


-- 4.