From 92afbfb3ae8e1a8824417289c17e47939083ccee Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Sun, 20 Apr 2008 22:24:03 -0500 Subject: use the commentstring option to filter out most comment strings from our display --- vimrc | 9 +++++++++ 1 file changed, 9 insertions(+) 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', '') -- cgit v1.2.3