添加新行的命令(在选择之前或之后) [英] Command to add a new line (before or after selections)

查看:38
本文介绍了添加新行的命令(在选择之前或之后)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有命令/包在当前选择之前或之后添加一行,即:
1) 适用于多个选择,
2) 不改变选择或移动光标(新行产生的偏移除外)?

Is there a command/package to add a line before or after current selections, that:
1) works with multiple selections,
2) doesn't change selections or move the cursors (except for the offset created by the new lines) ?

我知道 Ctrl + EnterCtrl + Shift + Enter 但这些命令在 2 处失败).

I'm aware of Ctrl + Enter and Ctrl + Shift + Enter but these command fail at 2).

这是一个关于 Atom 的示例(向下复制行,然后在选择前添加一行).

Here is an example on Atom (duplicating lines downward, then adding a line before selection).

如果没有,是否可以通过包轻松添加?

If not, can it be easily added via a package?

推荐答案

我没有找到任何可以做的,所以我做了一个新的包:https://marketplace.visualstudio.com/items?itemName=dorian-marchal.add-line-break

I didn't find anything to do that, so I made a new package: https://marketplace.visualstudio.com/items?itemName=dorian-marchal.add-line-break

要安装它,请执行 Ctrl + P 并运行 ext install dorian-marchal.add-line-break.

To install it, do Ctrl + P and run ext install dorian-marchal.add-line-break.

这将添加两个新的快捷方式:
- Ctrl + DownArrow:在选择之前添加一行.
- Ctrl + UpArrow:在选择后添加一行.

This will add two new shortcuts:
- Ctrl + DownArrow: Add a line before the selections.
- Ctrl + UpArrow: Add a line after the selections.

这篇关于添加新行的命令(在选择之前或之后)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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