使用 Sublime Text 在特定字符串后删除/添加换行符 [英] Remove/Add Line Breaks after Specific String using Sublime Text

查看:125
本文介绍了使用 Sublime Text 在特定字符串后删除/添加换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Sublime Text 2 - 是否可以在文本文件中的特定字符串之后插入换行符/text return,例如通过使用 FindReplace 工具?

Using Sublime Text 2 - Is it possible to insert a line break/text return after a specific String in a text file e.g. by using the FindReplace tool?

(额外问题:是否可以删除特定字符串后的所有换行符)

(Bonus question: Is it possible to remove all line breaks after a specific String)

推荐答案

以下是您在 Mac 上的操作方法:

Here's how you'd do it on a Mac:

Command+F > 输入字符串 > Control+Command+G > ESC > 右箭头 > 换行

Command+F > type string > Control+Command+G > ESC > Right Arrow > line break


Windows/Linux(未经测试):

Control+F > 输入字符串 > Alt+F3 > ESC > 右箭头 > 换行

Control+F > type string > Alt+F3 > ESC > Right Arrow > line break


重要的部分是 Control+Command+G 选择所有匹配项.
选择您要查找的文本后,您可以使用提供的多个光标来执行您想要的任何文本操作.


The important part being Control+Command+G to select all matches.
Once you've selected the text you're looking for, you can use the provided multiple cursors to do whatever text manipulation you want.

提示:您可以使用Command+click(或Control+click)手动实例化多个光标以达到类似的结果.

Protip: you can manually instantiate multiple cursors by using Command+click (or Control+click) to achieve similar results.

这篇关于使用 Sublime Text 在特定字符串后删除/添加换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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