在 Sublime Text 2 中重新格式化段落的常用方法是什么? [英] What is the usual way to reformat paragraph in Sublime Text 2?

查看:30
本文介绍了在 Sublime Text 2 中重新格式化段落的常用方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当你有一个长行的文本文件时,有什么方法可以将它们重新格式化为一定的宽度,而不把它们混在一起?

When you have a text file with long lines, what is the way to reformat them to a certain width, while not jumbling them up together?

一般来说,我在Vim中寻找的是这个,
(每一行都要做)

Generally, what I'm looking for is this in Vim,
(to be done on every line)

V
gq
j

预先设置textwidth.

推荐答案

ALT + CMD + q on OS X will hard wrap a行到您设置的任何标尺列.请参阅安德鲁对标尺设置的回答.

ALT + CMD + q on OS X will hard wrap a line to whatever ruler column you have set. See Andrew's answer for the ruler settings.

ALT + q 适用于 Windows,根据 此评论,它也适用于 Linux.

ALT + q works on Windows, and according to this comment, it works on Linux too.

根据评论,Sublime Text 并没有很好地包装评论,例如

According to the comments, Sublime Text doesn't wrap comments very well, such as

/*
 * Blah blah blah blah blah blah blah blah blah
 */

// Blah blah blah blah blah blah blah blah blah

插件 Sublime Wrap Plus 可用于包装这些.但是,如果您选择所有文件似乎效果不佳,如果您只选择要换行的注释行似乎效果最好.(在 Sublime Text 3 中测试,而不是 2).

The plugin Sublime Wrap Plus can be used to wrap these. However, it doesn't seem to work well if you Select All your file, it seems to work best if you select only the comment lines that you want to wrap. (Tested in Sublime Text 3, not 2).

这篇关于在 Sublime Text 2 中重新格式化段落的常用方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆