更改所选文本行的长度使文本升华3?

时间:2019-06-27 14:11:33

标签: sublimetext3

是否可以将选定的长文本分成多行?

例如:从这里

French President Emmanuel Macron said France will not accept text that does not mention the historic Paris accord.

"If we don't talk about the Paris agreement and if we don't get an agreement on it among the 20 members in the room, we are no longer capable of defending our climate change goals and France will not be part of this," he said on Wednesday.

France was one of the main drivers behind the Paris accord and the French parliament is now debating an energy bill that targets net zero greenhouse gas emissions by 2050.

"Negotiations on the topic of climate will be especially difficult this time," a German government official said.

像这样

French President Emmanuel Macron said France will not accept text that does not 
mention the historic Paris accord. 

"If we don't talk about the Paris agreement and if we don't get an agreement on 
it among the 20 members in the room, we are no longer capable of defending our 
climate change goals and France will not be part of this," he said on 
Wednesday. 

France was one of the main drivers behind the Paris accord and the French 
parliament is now debating an energy bill that targets net zero greenhouse gas 
emissions by 2050. 

"Negotiations on the topic of climate will be especially difficult this time," 
a German government official said.

1 个答案:

答案 0 :(得分:1)

有两种方法可以执行这样的操作,具体取决于您是想保留文本本身还是能够阅读长行还是要实际修改文件。

软包装

如果您只想查看文本,但在物理上保持原样,则您需要的是Word Wrapping。您可以切换View > Word Wrap的状态以打开和关闭换行,并且View > Word Wrap Column中的选项指定换行发生的位置。 Automatic选择窗口的边缘,或者您可以为要包装的数据指定特定的列。

这是Soft Wrapping;您会注意到,装订线中的线与实际线不是1:1对应的,因为有一条物理线,但有多条逻辑线(此处将wrap设置设置为Automatic):

Example of Soft Wrapping

自动换行状态由默认首选项中的word_wrap设置控制;确定默认的包装状态是什么。从菜单更改自动换行将仅对当前正在编辑的文件进行更改,因此,如果要永久更改状态,则应更改该设置。

此外,wrap_width设置控制进行自动换行的位置,其中0(默认值)是窗口的宽度(即菜单中的Automatic设置)。 View > Word Wrap Column下的菜单项将此设置的值更改为特定值,但是您可以在首选项中设置任何您喜欢的值。

硬包装

如果要实际修改文本,则需要Edit > Wrap菜单中的选项。在这里,您可以选择将所有文字都换行的文本,也可以将光标放在一个段落中以仅换行一个段落。

您可以选择在特定列或当前标尺处换行,可以在View > Ruler中指定。

以这种方式完成后,文件的内容将被物理修改(在这里,我选择了在70列进行换行的选项,并从上方关闭了软换行):

Example of hard wrapping

标尺(或多个标尺;可以有多个)的位置由rulers设置控制,该设置默认为空。上面的菜单项将当前文件中的标尺设置为菜单项中显示的值,但是您可以将rulers设置设置为所需的任何值。如上所述,设置的默认值位于“首选项”文件中,菜单项仅更改当前文件的状态,因此您需要修改首选项以设置永久值。

包裹在特定列上的菜单项使用带有指定wrap_lines参数的width命令也是毫无意义的,因此,如果需要,您可以制作一个可以在任意位置包裹的自定义键绑定你想要的。