summaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-04-20 22:24:03 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-04-20 22:24:03 -0500
commitbc2932b70cdcb1b89c9c1c1dec3a97ac37e77e6d (patch)
treee0cabde9f3d20a2f283ff991a666f4d1c09b5391 /vimrc
parent7c77077867266e23fc0d83dc65cf4b3e1ff0884c (diff)
downloadconf-bc2932b70cdcb1b89c9c1c1dec3a97ac37e77e6d.tar.gz
conf-bc2932b70cdcb1b89c9c1c1dec3a97ac37e77e6d.zip
use the commentstring option to filter out most comment strings from our display
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc9
1 files changed, 9 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index e9b3b27..6f84790 100644
--- a/vimrc
+++ b/vimrc
@@ -330,6 +330,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', '')