Is there a way to totally hide certain lines? I do not want folding, I one them to not be visible at all.
Example: I program with php; functions and class variables have phpdocs, and I hate how much vertical space lines with nothing but /**
and */
can take. Thus I would like to not show them (and most likely some other things). Though I have doubts that that is possible...
Note: I know about global commands and they don't do what I want. You can one of printing of what I want. But I want lines hidden in the editing area.
You can make comments invisible:
:hi! Comment guifg=bg ctermfg=white
Or
:hi! link Comment Ignore
I know this isn't really what you're asking for, but have you tried using folding with a blank foldtext
? That way the lines a folded region appears like an empty line. To do this, set
set foldmethod=marker
set foldmarker=\/**,*\/
set foldtext='\ '
I prefer a foldtext which indicates that there's something there, possibly by making is look like a single commented line. In this case, replacing the first folded line with a single comment string //
at the current indent level:
set foldtext=substitute(getline(v:foldstart),'\\/\\*\\*.*','\\/\\/','g'
I find this unobtrusive, while still reminding me that there is some hidden text.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With