summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2017-02-15 12:00:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2017-08-16 18:56:54 +0000
commitba1b1ddf340c1ba87d0c4f6f0ae8ea836167eb26 (patch)
treef435dcb22cbd91a2e5b0bd5882d739a935237292
parentAdding listchars by default. (diff)
downloadvim-ba1b1ddf340c1ba87d0c4f6f0ae8ea836167eb26.zip
vim-ba1b1ddf340c1ba87d0c4f6f0ae8ea836167eb26.tar.xz
Adding highlighting for extra whitespaces by default.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--debian/runtime/vimrc15
1 files changed, 15 insertions, 0 deletions
diff --git a/debian/runtime/vimrc b/debian/runtime/vimrc
index bfb0570..46690ef 100644
--- a/debian/runtime/vimrc
+++ b/debian/runtime/vimrc
@@ -59,6 +59,21 @@ set noerrorbells " Don't ring the bell for error messages
set list
set listchars=tab:»·,trail:·,extends:»
+" Highlight extra whitespace
+highlight ExtraWhitespace ctermbg=red guibg=red
+
+" Show trailing whitespace
+":match ExtraWhitespace /\s\+$/
+
+" Show trailing whitepace and spaces before a tab
+:match ExtraWhitespace /\s\+$\| \+\ze\t/
+
+" Show tabs that are not at the start of a line
+":match ExtraWhitespace /[^\t]\zs\t\+/
+
+" Show spaces used for indenting (so you use only tabs for indenting)
+":match ExtraWhitespace /^\t*\zs \+/
+
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local