bash 在 nano 中向上/向下移动整行快捷方式(类似于 intelliJ 或 Visual Studio)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33217564/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 13:46:06  来源:igfitidea点击:

Move whole line up/down shortcut in nano (analogue to intelliJ or Visual Studio)

linuxbasheditornano

提问by Blaise

How to move a line of text up/down in Nano linux command line editor?

如何在Nano linux 命令行编辑器中上下移动一行文本?

Is there any analogue way to do that as in IntelliJ Idea:

是否有任何类似的方法可以像IntelliJ Idea那样做到这一点:

  1. Place the caret at the line to be moved.
  2. Do one of the following:
  1. 将插入符号放在要移动的行上。
  2. 执行以下操作之一:

On the main menu, choose Code | Move Line Up or Code | Move Line Down.

在主菜单上,选择Code | Move Line Up or Code | Move Line Down

Press Shift+Alt+Upor Shift+Alt+Down.

Shift+ Alt+UpShift+ Alt+ Down

回答by Alvaro Gutierrez Perez

You can use Ctrl+Kto cut a line, move to destination position and press Ctrl+Uto paste it.

您可以使用Ctrl+K剪切一条线,移动到目标位置并按Ctrl+U粘贴它。