summaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc9
1 files changed, 9 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 52a05e9..efc3550 100644
--- a/vimrc
+++ b/vimrc
@@ -296,6 +296,15 @@ function Base_foldtext(...)
let foldmarkers = split(&foldmarker, ',')
let line = substitute(line, '\V\s\?' . foldmarkers[0] . '\s\?', ' ', '')
+ " remove comments that we know about
+ let comment = split(&commentstring, '%s')
+ if comment[0] != ''
+ let line = substitute(line, '\V' . comment[0], ' ', '')
+ endif
+ if comment[1] != ''
+ let line = substitute(line, '\V' . comment[1], ' ', '')
+ endif
+
" remove any remaining leading or trailing whitespace
let line = substitute(line, '^\s*\(.\{-}\)\s*$', '\1', '')