-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: command to hard wrap text block at certain column (Sublime Text: cmd+shift+Q) #2770
Comments
I was just thinking the other day of writing an extension for this (haven't found an existing one), that supported comments for various languages. Is it only comments you're needing this for or other things too? |
Comments are definitely the 80% (99%?) use-case. I guess the only other place I could see it being useful is in a big multi-line string literal. But even that's a stretch. |
@peterbourgon I've just published the extension rewrap. The readme is a bit hastily put together so hope you can work it out. At the moment it only supports C-style comments (// and /* ... */) so adding more languages is the next priority. Would appreciate any feedback you have :) |
@stkb I've installed it and had a play. Works nicely! Thank you very much; one happy customer here. |
OMG @stkb you are my personal hero. This was my number one pain point when switching from Sublime. Thanks so much! |
One oddity is that it seems to leave wrapped text selected if my cursor was in the text that got wrapped, which means I end up overwriting the text if I wrap in the middle of typing. So like, if I write "abc 123 456" and my cursor is after the 6, and the wrapping point is between the letters and numbers. When I wrap, all the text that gets moved to the next line (the numbers) will be selected (with my cursor at the end of the selection). |
@natefinch Thanks for the compliment :) And yeah the selection and text cursor position after wrapping is something I've never been happy with, just haven't got round to fully investigating yet. Sometimes vscode seems to do one thing, sometimes another. I've created an issue for it in the repo: stkb/Rewrap#4 |
How is this not built in? Thanks @stkb |
This is a followup from vscode-go/#113. In Sublime Text, if I place the cursor in a paragraph, or select a block of text, and press cmd+shift+Q, it will hard-wrap the paragraph/block at the currently defined wrap column. It also preserves comment semantics, i.e. prefix or block-level comment definitions.
This feature is incredibly valuable.
The text was updated successfully, but these errors were encountered: