Sunday, January 1, 2017

Using gq with "-" lists in comments

When using "gq" to format text, Vim treats lines lines starting with "-"
as lists and pads the line with whitespace for subsequent lines to align
the text so this:

- The quick brown fox jumps over the lazy dog

... becomes this:

- The quick brown fox jumps
over the lazy dog

When wrapping text inside of comments in various languages (usually C,
Awk and Python), the same thing does not happen so this:

# - The quick brown fox jumps over the lazy dog

... becomes this:

# - The quick brown fox jumps
# over the lazy dog

... when what I want is this:

# - The quick brown fox jumps
# over the lazy dog

Is it possible to get the behavior I want without writing a custom
fmt-esque command?

Eric

--
--
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:

Post a Comment