Visual Studio Code 中的重复行 [英] Duplicate line in Visual Studio Code

查看:80
本文介绍了Visual Studio Code 中的重复行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到在 Visual Studio Code 中复制一行的快捷方式(我使用的是 1.3.1)我尝试了明显的 CTRL + D 但这并没有似乎行不通.

解决方案

点击文件 > 首选项 > 键盘快捷键:

在键盘快捷键中搜索 copyLinesDownActioncopyLinesUpAction

通常是SHIFT+ALT +

<小时>

Ubuntu 更新:

Ubuntu 似乎隐藏了 VSCode 无法看到的快捷方式(即它可能自己使用它).GitHub 上有一个关于此的问题.

为了在 Ubuntu 中工作,您必须定义自己的快捷方式,例如使用 ctrl+shift+alt+jCTRL + 复制该行SHIFT + ALT + k 你可以像这样使用 keybindings.json:

<预><代码>[{ "key": "ctrl+shift+alt+j", "command": "editor.action.copyLinesDownAction","when": "editorTextFocus && !editorReadonly" },{ "key": "ctrl+shift+alt+k", "command": "editor.action.copyLinesUpAction","when": "editorTextFocus && !editorReadonly" }]

I am trying to find the shortcut for duplicating a line in Visual Studio Code (I am using 1.3.1) I tried the obvious CTRL + D but that doesn't seem to work.

解决方案

Click File > Preferences > Keyboard Shortcuts:

Search for copyLinesDownAction or copyLinesUpAction in your keyboard shortcuts

Usually it is SHIFT+ALT +


Update for Ubuntu:

It seems that Ubuntu is hiding that shortcut from being seen by VSCode (i.e. it uses it probably by its own). There is an issue about that on GitHub.

In order to work in Ubuntu you will have to define your own shortcut, e.g. to copy the line using ctrl+shift+alt+j and CTRL +SHIFT + ALT + k you could use a keybindings.json like this:

[
    { "key": "ctrl+shift+alt+j", "command": "editor.action.copyLinesDownAction",
                                    "when": "editorTextFocus && !editorReadonly" },
    { "key": "ctrl+shift+alt+k", "command": "editor.action.copyLinesUpAction",
                                    "when": "editorTextFocus && !editorReadonly" }
]

这篇关于Visual Studio Code 中的重复行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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