blob: 3c872d986227421e79e2ea452734b9983c15b4a9 [file] [log] [blame]
Misha Brukman3d6eea52005-04-24 17:05:04 +00001" LLVM coding guidelines conformance for VIM
2" Maintainer: LLVM Team, http://llvm.cs.uiuc.edu
3" Updated: 2005-04-24
4" WARNING: Read before you source in all these commands and macros! Some
Misha Brukman2bb55082005-05-12 21:41:48 +00005" of them may change VIM behavior that you depend on.
Misha Brukman3d6eea52005-04-24 17:05:04 +00006
7" Wrap text at 80 cols
8set textwidth=80
9
10" A tab produces a 2-space indentation
11set tabstop=2
12set shiftwidth=2
13set expandtab
14
Misha Brukman2bb55082005-05-12 21:41:48 +000015" Optional
16" C/C++ programming helpers
17set autoindent
18set smartindent
19" Add and delete spaces in increments of `shiftwidth' for tabs
20set smarttab
21
Misha Brukman3d6eea52005-04-24 17:05:04 +000022" Enable filetype detection
23filetype on
24
25" LLVM Makefiles can have names such as Makefile.rules or TEST.nightly.Makefile,
26" so it's important to categorize them as such.
27augroup filetype
28 au! BufRead,BufNewFile *Makefile* set filetype=make
29augroup END
30
31" In Makefiles, don't expand tabs to spaces, since we need the actual tabs
32autocmd FileType make set noexpandtab
33
34" Useful macros for cleaning up code to conform to LLVM coding guidelines
35
36" Delete trailing whitespace and tabs at the end of each line
37map :dtws :%s/[\ \t]\+$//
38
39" Convert all tab characters to two spaces
40map :untab :%s/\t/ /g