In Emacs I'm quite used to M-q
as a keychord for "intelligently reflow and re-indent the current block or region of text to match the desired width". It's actually a very sophisticated command and difficult to get right across languages and semantic regions within a document.
But, the simplest and most frequently useful version is just to wrap lines in a comment block.
Does such a command exist for VSCode? How do you use it? How do you configure it?
As an Emacs user myself I dearly missed this feature in VSCode. Foturnately there is an extension that offers this featuree, it is called Rewrap. It handles both plain text and comments in code. Just install it. By default, it binds to M-q
.
For my needs, I have found it to be just as good as fill-paragraph (M-q)
in Emacs. In some ways, it is better. For instance, it will respect JSDoc comments. In other ways, it is worse. It doesn't handle Lisp for instance.
Do note, that the default column to wrap at is 70 in Emacs and 80 with Rewrap. If you want to keep the column at 70 as in Emacs insert this in your settings.json
:
"rewrap.wrappingColumn": 70
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