我正在寻找一种方法,在 TextMate 中所选文本的每行上方插入一行文本。
有人知道如何编写命令或片段来执行此操作吗?
示例,所选文本:
This is line 1
This is line 2
This is line 3
This is line 4
我想在所选的每行上方插入以下内容:
--我是插入的一行--
这将导致以下结果:
-
-im an inserted line--
This is line 1
--im an inserted line--
This is line 2
--im an inserted line--
This is line 3
--im an inserted line--
This is line 4
可以使用 *NIX 命令来完成此操作,然后我可以设置 TextMate 命令来执行此操作吗?
最佳答案
选择文本,按 APPLE + F,然后将 \n
替换为 \n--Im an inserted line--\n
。确保“正则表达式”已勾选,并且按住 SHIFT 键的同时按“全部替换”按钮。
关于linux - TextMate bundle 在所选的每行上方插入一行文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6860918/