簡體   English   中英

VS Code:重新包裝文本或注釋塊

[英]VS Code: Rewrap block of text or comment

如何重新包裝文本塊或長注釋以容納 80 列?

我不希望它只呈現自動換行(這可以通過 Edit -> Toggle Word Wrap 或設置"editor.wordWrap": "on"輕松實現),但我希望它實際上插入硬換行符。 此功能在某些編輯器中稱為“填充段落”。

例如:

// This is a very long comment. I would like for this comment to occupy multiple lines rather than a single line, so that it is easy to read for other people.

現在我想按一些鍵來獲得:

// This is a very long comment. I would like for this comment to occupy
// multiple lines rather than a single line, so that it is easy to read for
// other people.

看起來Rewrap 可以滿足您的需求。 不確定是否有本地方式。 他們仍在添加許多功能。

VSCodeVim支持這個特性。 只需選擇一個文本塊,然后按gq :)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM