1 " LLVM coding guidelines conformance for VIM
3 " Maintainer: The LLVM Team, http://llvm.org
4 " WARNING: Read before you source in all these commands and macros! Some
5 " of them may change VIM behavior that you depend on.
7 " You can run VIM with these settings without changing your current setup with:
8 " $ vim -u /path/to/llvm/utils/vim/vimrc
13 " Wrap text at 80 cols
16 " A tab produces a 2-space indentation
21 " Highlight trailing whitespace
22 highlight WhitespaceEOL ctermbg=DarkYellow guibg=DarkYellow
23 match WhitespaceEOL /\s\+$/
26 " C/C++ programming helpers
29 " Add and delete spaces in increments of `shiftwidth' for tabs
32 " Highlight syntax in programming languages
35 " Enable filetype detection
38 " LLVM Makefiles can have names such as Makefile.rules or TEST.nightly.Makefile,
39 " so it's important to categorize them as such.
41 au! BufRead,BufNewFile *Makefile* set filetype=make
44 " In Makefiles, don't expand tabs to spaces, since we need the actual tabs
45 autocmd FileType make set noexpandtab
47 " Useful macros for cleaning up code to conform to LLVM coding guidelines
49 " Delete trailing whitespace and tabs at the end of each line
50 command! DeleteTrailingWs :%s/[\ \t]\+$//
52 " Convert all tab characters to two spaces
53 command! Untab :%s/\t/ /g