Here is a small script that will detect some guideline violations for vim. I put it in my .vimrc and it highlight all the errors it can find in all opened files. I'd like to know if you made improvements on it. {{{ :fu FuncHaikuCheck() call matchadd('Search', '\%>80v.\+', -1) " line over 80 char call matchadd('Search', '^\s* \s*', -1) " spaces instead of tabs call matchadd('Search', '\(for\|if\|select\|while\)(', -1) "missing space after control statement call matchadd('Search', '//\S', -1) " Missing space at comment start call matchadd('Search', '\w[,=>+\-*;]\w', -1) "operator without space around it (without false positive on "templated) call matchadd('Search', '^[^#].*[^<]\zs\w*/\w', -1) "operator without space around it (without false positive on "#include ) call matchadd('Search', '^[^/]\{2}.*\zs[^*][=/+\-< ]$', -1) "operator at end of line (without false positives on /* and */, nor "char*\nClass::method()) call matchadd('Search', '^[^#].*\zs[^<]>$', -1) " > operator at end of line (without false positive on #include ) call matchadd('Search', '){', -1) " Missing space after method header call matchadd('Search', '}\n\s*else', -1) " Malformed else call matchadd('Search', '\s$', -1) "Spaces at end of line call matchadd('Search', ',\S', -1) " Missing space after comma call matchadd('Search', '^}\n\{1,2}\S', -1) " Less than 2 lines between functions call matchadd('Search', '^}\n\{4,}\S', -1) " More than 2 lines between functions :endfu }}} == Calling the function == The obvious way to enable the script is to do it by hand : {{{ :call FuncHaikuCheck() }}} It is also possible to make it run on every opened file (this is a bit annoying when using vim for something else than Haiku or C++ files) {{{ " autocmd that will set up the w:created variable (vim tip 1598) " so we can run the check only once per window autocmd VimEnter * autocmd WinEnter * let w:created=1 " call the function on all opened files autocmd WinEnter * if !exists('w:created') | call FuncHaikuCheck() | endif autocmd BufWinEnter * call FuncHaikuCheck() }}} The last option is to define a keyboard shortcut to enable it (control+F3 in this example) : {{{ map :call FuncHaikuCheck() }}} These rules have been ported to a standalone python program see the Style Checker Tools paragraph in the [http://www.haiku-os.org/development/coding-guidelines Haiku coding guidelines] and [http://dev.haiku-os.org/browser/haiku/trunk/src/tools/checkstyle/ src/tools/checkstyle/]