Commit cae6096f authored by Charl's avatar Charl
Browse files

Added Error Highlighting fo NON K&R style as well as spaces before and after...

Added Error Highlighting fo NON K&R style as well as spaces before and after control struct condition brackets
parent a402dc31
......@@ -44,11 +44,17 @@ highlight CursorLine cterm=none ctermbg=235
set cursorline
" Highlight messed up tab/spaces
highlight ExtraWhitespaces ctermbg=202
call matchadd('ExtraWhitespaces',' \t')
call matchadd('ExtraWhitespaces','\t ')
call matchadd('ExtraWhitespaces','^ ')
call matchadd('ExtraWhitespaces','\s\+$')
highlight HighlightProblems ctermbg=202
call matchadd('HighlightProblems',' \t')
call matchadd('HighlightProblems','\t ')
call matchadd('HighlightProblems','^ ')
call matchadd('HighlightProblems','\s\+$')
" Highlight NON K&R style control structures
call matchadd('HighlightProblems','^\s*\(foreach\|while\|do\|for\|if\|else\).*[^\{]\s*$')
" Highlight missing space BEFORE control struct and opening (
call matchadd('HighlightProblems','^\s*\(foreach\|while\|do\|for\|if\|else\)(')
" Highlight missing space AFTER control struct and opening (
call matchadd('HighlightProblems','^\s*\(foreach\|while\|do\|for\|if\|else\).*){')
" Don't use backup files
set nobackup
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment