Friday, February 19, 2016

Getting } to treat lines with only white space as paragraph delimiter

I use vim to code in various languages, all of them using indentation
to show the level of nesting of loops, flow control structures, etc.
In http://groups.google.com/forum/#!topic/vim_use/uaOVEC8YioQ, I asked
for tricks in drawing vertical lines connecting the statements that
delimit indented chunks of code. In that context, it was for
pseudocode. Now, I'm seeking the same for implementation code, so I
don't want real vertical bars in the text file; I just want vertical
bars to be displayed by vim. Following the suggestion by Jurgen, I'm
using:

:set formatoptions+=tcql
:set comments+=n:\|

This works if I use tabs instead of spaces (noexpandtab, and possibly
needing %retab!). However, this leaves gaps in the vertical lines
where there file has empty lines of text (no spaces between the line's
beginning & end, i.e., ^$).

To avoid gaps in the vertical lines, I need to avoid empty lines by
putting in the requisite number of tabs to reflect the level of
indentation of the blank line (by which I mean a line containing only
white space). However this messes up my use of the } command in
normal mode. Is there any way to get } to treat blank lines as
paragraph delimiters even if the lines contain white space (and white
space only)?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: