1" 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. 6 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 15" Optional 16" C/C++ programming helpers 17set autoindent 18set smartindent 19" Add and delete spaces in increments of `shiftwidth' for tabs 20set smarttab 21 22" 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 41