vscode 自定义快捷键

这两天用vscode写了下Python,感觉很舒服,只是快捷键不如人意,略作修改,放上来作为备份。smile~

主要更改:

代码格式化   ctrl+alt+l
执行代码    ctrl+enter
增加一行    shift+enter
删除一行 ctrl+d
代码提示 alt+/ 或 ctrl+j
复制一行代码 ctrl+alt+up/down

用惯了Eclipse的人会觉得很熟悉,只有格式化代码是Intellij的快捷键。

C:\Users\Administrator\AppData\Roaming\Code\User\keybindings.json

// 将键绑定放入此文件中以覆盖默认值
[
{ //行选定
"key": "ctrl+i",
"command": "expandLineSelection",
"when": "editorTextFocus"
},
{ //重做
"key": "ctrl+y",
"command": "redo",
"when": "editorTextFocus && !editorReadonly"
},
{ //增加注释行
"key": "ctrl+k ctrl+c",
"command": "editor.action.addCommentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+k", //与ctrl+d互换了
"command": "editor.action.addSelectionToNextFindMatch",
"when": "editorFocus"
},
{ //块注释
"key": "ctrl+shift+/", //shift+alt+a
"command": "editor.action.blockComment",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+alt+down", //shift+alt+down改为ctrl+alt+down
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+alt+up", //shift+alt+up改为ctrl+alt+up,互换!
"command": "editor.action.copyLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+d", //互换了 ctrl+shift+k
"command": "editor.action.deleteLines",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+alt+l", // 格式化代码,由shift+alt+f改为ctrl+alt+l,互换!
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+k ctrl+f",
"command": "editor.action.formatSelection",
"when": "editorHasDocumentSelectionFormattingProvider && editorHasSelection && editorTextFocus && !editorReadonly"
},
{
"key": "f12",
"command": "editor.action.goToDeclaration",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "ctrl+f12",
"command": "editor.action.goToImplementation",
"when": "editorHasImplementationProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "shift+alt+up", // shift+alt+up互换,原为ctrl+alt+up
"command": "editor.action.insertCursorAbove",
"when": "editorTextFocus"
},
{
"key": "shift+alt+down", // shift+alt+down互换,原为ctrl+alt+up
"command": "editor.action.insertCursorBelow",
"when": "editorTextFocus"
},
{
"key": "shift+enter", //ctrl+enter改为shift+enter
"command": "editor.action.insertLineAfter",
"when": "editorTextFocus && !editorReadonly"
},
// {
// "key": "ctrl+shift+enter",
// "command": "editor.action.insertLineBefore",
// "when": "editorTextFocus && !editorReadonly"
// },
{
"key": "alt+/", // ctrl+space 改为alt+/
"command": "editor.action.triggerSuggest",
"when": "editorHasCompletionItemProvider && editorTextFocus && !editorReadonly"
},
{
"key": "shift+alt+f", //与shift+alt+f互换,原为shift+alt+f
"command": "rest-client.rerun-last-request",
"when": "editorTextFocus && editorLangId == 'http'"
},
{
"key": "shift+alt+f", //与shift+alt+f互换,原为shift+alt+f
"command": "rest-client.rerun-last-request",
"when": "editorTextFocus && editorLangId == 'plaintext'"
},
{
"key": "shift+alt+f", //与shift+alt+f互换,原为shift+alt+f
"command": "rest-client.rerun-last-request",
"when": "resourceScheme == 'rest-response'"
},
{
"key": "ctrl+.", //原为ctrl+j
"command": "workbench.action.togglePanel"
},
    {
        "key": "ctrl+enter", //原为ctrl+shift+b
        "command": "workbench.action.tasks.build"
    }
]

参考链接:

用VSCode写python的正确姿势

另:如果想偷懒,有个code runner的插件可以试一下~

vscode 自定义快捷键的更多相关文章

  1. VSCode之快捷键和常用插件

    前言 介绍一下我在VSCode中常用的一些快捷方式: ctrl+上下箭头 上下滚动页面 Ctrl+Shift+K 删除某一行 Alt+ ↑ / ↓ 移动某一行 Shift+Alt + ↓ / ↑ 复制 ...

  2. vscode常用快捷键与插件推荐

    一.vscode常用快捷键 1.新建文件:chtr+n 2.新开窗口:ctrl+shift+n 3.分屏:ctrl+1/2/3  4.切换文件:alt+1/2/3或ctrl+tab 5.关闭当前窗口: ...

  3. Revit中如何自定义快捷键

    最佳的绘图方式是左手键盘,右手鼠标,使用快捷键将大大提高绘图效率,Revit同样提供了自定义绘图工具快捷键的功能(Revit2011及以后版本),有两种方式调出自定义快捷键窗口,第一种是Revit窗口 ...

  4. word 2010自定义快捷键提高工作效率

    经常使用word处理文档, 做笔记的时候会把word文档框缩小,以便同时看pdf同时记录笔记,但是缩小的word框不能把所有的菜单项显示出来,我比较常用那个插入边框下面的那个横线来做分割符,但是缩小了 ...

  5. ultraEdit32 /uedit32 自定义快捷键/自定义注释快捷键

    编辑器一直用vim,但同事写VHDL 用的是utraledit32 ,为了更好的沟通,我也下载了最新破解版本:http://pan.baidu.com/s/1qWCYP2W 刚开始用找不到注释的快捷键 ...

  6. eclipse设置自定义快捷键

    eclipse有很多强大且人性化的功能,而各项功能有时又隐藏得比较深(需要点击数次菜单才能找到),而系统提供的快捷键有时比较难记住甚至根本没有提供快捷键时,就需要自己手动设置快捷键了.设置方法有两种, ...

  7. SQL Server 自定义快捷键

    SQL Server程序员经常要在SSMS(SQL Server Management Studio)或查询分析器(2000以前)中编写T-SQL代码.以下几个技巧,可以提升工作效率. 以下说明以SS ...

  8. 【Windows 10 应用开发】自定义快捷键

    上一篇鸟文中,老周通过史无前例的代码向各位 demo 了访问键的用法(即 Alt + 某某).不过,大伙伴们一定会发现,访问键毕竟限制较大,不太灵活,也不好发挥,于是就需要自定义快捷键了. 其实,自定 ...

  9. jira7通过全局js给编辑区自定义快捷键【原】

    jira7编辑区自定义快捷键 本文主要描述了jira7如何通过添加全局js引用,给文本编辑区自定义快捷键用以快速填充模板内容. jira 3/4/5可参考官方api https://developer ...

随机推荐

  1. HTTP响应状态码

    1XX:代表提示信息 2XX:代表成功信息 3XX:代表重定向 4XX:代表客户端错误信息 5XX:代表服务器错误 信息 500:500 错误是服务器内部错误 ,而且是程序上错误 为多,可能是你的用户 ...

  2. 微信公众号抢现金红包活动的核心代码分析(asp.net C#)

    今年春节微信抢红包,我想各位都还记得.最近很多商家也在使用公众号给粉丝发红包,做营销活动.吸粉活动或者是反馈老用户等. 我们作为第3方开发者,就义不容辞的来给这些商家服务了.首先我们得会使用程序来写抢 ...

  3. [Windows Azure] How to use the Queue Storage Service

    How to use the Queue Storage Service version 1.7 version 2.0 This guide will show you how to perform ...

  4. 2017-04-26 ios ipv6那些事(已完美解决)

    2017-04-26 ios ipv6那些事(已完美解决)   工作单位性质属于外包公司,每天都有几十的app要提交上传至应用市场,于2017年3月份接到ios工程师反馈 Guideline 2.1 ...

  5. 关于CentOS 6下Hadoop占用系统态CPU高的处理办法【转】

    一次不经意发现Hadoop的系统态CPU使用率很高,然后百度一下居然是个已知问题. RHEL6优化了内存申请的效率,而且在某些场景下对KVM的性能有明显提升:http://www.Linux-kvm. ...

  6. 【教程】linux下安装Google Chrome

    google chrome       google浏览器一直都是深受大家喜爱的一个浏览器,而且其跨平台性比较好,这对于书签同步来说是非常重要的.但是在linux下,默认的是火弧浏览器,而google ...

  7. Huawei AP3030DN固件升级

    进入uboot: 上电,当出现Press f of F stop Auto-Boot in 3 seconds: 0 时按键盘上的F键 Password for uboot cmd line : 密码 ...

  8. Nginx作为反向代理服务器

    前言:Nginx通过proxy模块实现反向代理功能.在作为web反向代理服务器时,nginx负责接收客户请求,并能够根据URI.客户端参数或其它的处理逻辑将用户请求调度至上游服务器上(upstream ...

  9. C# JAVA 记录代码运行时间

    C# System.Diagnostics.Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); // 开始监视代码运行时间 // cod ...

  10. 基于CSS3鼠标滑过放大突出效果

    还记得之前分享过一款CSS3图片悬停放大特效,效果非常不错.今天我们要再来分享一款类似的CSS鼠标滑过放大突出效果,只不过之前那个是图片,这次是色块,其实掌握了其CSS原理,任何网页元素都可以实现这种 ...