Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The desired effect can be achieved via folding. If we create one-line
folds separately containing empty lines of a buffer, they all will be
marked out as folded. The only thing left will be to customize the
highlighting accordingly.
First of all, we need to automatically create the folds. For this
purpose, we can switch folding to the
exprmethod and then setthe
foldexproption to evaluate to a non-zero value for emptylines only:
What we should do next for the trick to work out is to make those
folds close automatically in order to trigger the folding
highlighting:
Finally, to repeat a custom character in the folding line, we just
empty the text displayed for a closed fold, and change the filling
character:
Combining the above commands in one function for convenience,
we obtain the following:
The downside of this trick, of course, is that it interferes with the
usual applications of folding, and cannot be easily used without
modifications if the user extensively relies on folding for other
purposes.