Commit 23e88257 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Merge branch 'highlight' into 'master'

Highlight

Added highlighting for the following cases:
- NON K&R style control structures
- Missing space before control keyword and opening bracket
- Missing space after control closing bracket and opening K&R style brace
parents a402dc31 cae6096f
......@@ -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