blob: 6efd59c305b01d6caf6647b74b26ab44ee0d503b [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
5" of them may change VIM behavior that you depend on and the
6" settings here may depend on other settings that you may have.
7
8" Wrap text at 80 cols
9set textwidth=80
10
11" A tab produces a 2-space indentation
12set tabstop=2
13set shiftwidth=2
14set expandtab
15
16" Enable filetype detection
17filetype on
18
19" LLVM Makefiles can have names such as Makefile.rules or TEST.nightly.Makefile,
20" so it's important to categorize them as such.
21augroup filetype
22 au! BufRead,BufNewFile *Makefile* set filetype=make
23augroup END
24
25" In Makefiles, don't expand tabs to spaces, since we need the actual tabs
26autocmd FileType make set noexpandtab
27
28" Useful macros for cleaning up code to conform to LLVM coding guidelines
29
30" Delete trailing whitespace and tabs at the end of each line
31map :dtws :%s/[\ \t]\+$//
32
33" Convert all tab characters to two spaces
34map :untab :%s/\t/ /g