File: c.vim

package info (click to toggle)
gimp 3.0.4-3%2Bdeb13u2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 210,304 kB
  • sloc: ansic: 842,353; lisp: 10,761; python: 10,318; cpp: 7,238; perl: 4,355; sh: 1,043; xml: 963; yacc: 609; lex: 348; javascript: 150; makefile: 43
file content (28 lines) | stat: -rw-r--r-- 1,017 bytes parent folder | download | duplicates (3)
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
28
" GIMP coding style for vim "

" To enable these vim rules for GIMP only, add this command to your vimrc:
" autocmd BufNewFile,BufRead /path/to/gimp/*.[ch] source /path/to/gimp/devel-docs/c.vim
"
" Do not use `set exrc` which is a security risk for your system since vim may
" be tricked into running shell commands by .vimrc files hidden in malicious
" projects (`set secure` won't protect you since it is not taken into account
" if the files are owned by you).

" GNU style
setlocal cindent
setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1
setlocal shiftwidth=2
setlocal softtabstop=2
setlocal textwidth=79
setlocal fo-=ro fo+=cql

" Tabs are always inserted as spaces.
set expandtab
" But if there are tabs already, show them as 8 columns.
setlocal tabstop=8

" Highlight in red trailing whitespaces and tabs everywhere.
highlight TrailingWhitespace ctermbg=LightRed guibg=LightRed
match TrailingWhitespace /\s\+$/
highlight ForbiddenTabs ctermbg=DarkRed guibg=DarkRed
2match ForbiddenTabs /\t/