vscode 自定义快捷键

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

主要更改:

  1. 代码格式化   ctrl+alt+l
  2. 执行代码    ctrl+enter
  3. 增加一行    shift+enter
  4. 删除一行 ctrl+d
  5. 代码提示 alt+/ ctrl+j
  6. 复制一行代码 ctrl+alt+up/down

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

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

  1. // 将键绑定放入此文件中以覆盖默认值
  2. [
  3. { //行选定
  4. "key": "ctrl+i",
  5. "command": "expandLineSelection",
  6. "when": "editorTextFocus"
  7. },
  8. { //重做
  9. "key": "ctrl+y",
  10. "command": "redo",
  11. "when": "editorTextFocus && !editorReadonly"
  12. },
  13. { //增加注释行
  14. "key": "ctrl+k ctrl+c",
  15. "command": "editor.action.addCommentLine",
  16. "when": "editorTextFocus && !editorReadonly"
  17. },
  18. {
  19. "key": "ctrl+shift+k", //与ctrl+d互换了
  20. "command": "editor.action.addSelectionToNextFindMatch",
  21. "when": "editorFocus"
  22. },
  23. { //块注释
  24. "key": "ctrl+shift+/", //shift+alt+a
  25. "command": "editor.action.blockComment",
  26. "when": "editorTextFocus && !editorReadonly"
  27. },
  28. {
  29. "key": "ctrl+alt+down", //shift+alt+down改为ctrl+alt+down
  30. "command": "editor.action.copyLinesDownAction",
  31. "when": "editorTextFocus && !editorReadonly"
  32. },
  33. {
  34. "key": "ctrl+alt+up", //shift+alt+up改为ctrl+alt+up,互换!
  35. "command": "editor.action.copyLinesUpAction",
  36. "when": "editorTextFocus && !editorReadonly"
  37. },
  38. {
  39. "key": "ctrl+d", //互换了 ctrl+shift+k
  40. "command": "editor.action.deleteLines",
  41. "when": "editorTextFocus && !editorReadonly"
  42. },
  43. {
  44. "key": "ctrl+alt+l", // 格式化代码,由shift+alt+f改为ctrl+alt+l,互换!
  45. "command": "editor.action.formatDocument",
  46. "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly"
  47. },
  48. {
  49. "key": "ctrl+k ctrl+f",
  50. "command": "editor.action.formatSelection",
  51. "when": "editorHasDocumentSelectionFormattingProvider && editorHasSelection && editorTextFocus && !editorReadonly"
  52. },
  53. {
  54. "key": "f12",
  55. "command": "editor.action.goToDeclaration",
  56. "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
  57. },
  58. {
  59. "key": "ctrl+f12",
  60. "command": "editor.action.goToImplementation",
  61. "when": "editorHasImplementationProvider && editorTextFocus && !isInEmbeddedEditor"
  62. },
  63. {
  64. "key": "shift+alt+up", // shift+alt+up互换,原为ctrl+alt+up
  65. "command": "editor.action.insertCursorAbove",
  66. "when": "editorTextFocus"
  67. },
  68. {
  69. "key": "shift+alt+down", // shift+alt+down互换,原为ctrl+alt+up
  70. "command": "editor.action.insertCursorBelow",
  71. "when": "editorTextFocus"
  72. },
  73. {
  74. "key": "shift+enter", //ctrl+enter改为shift+enter
  75. "command": "editor.action.insertLineAfter",
  76. "when": "editorTextFocus && !editorReadonly"
  77. },
  78. // {
  79. // "key": "ctrl+shift+enter",
  80. // "command": "editor.action.insertLineBefore",
  81. // "when": "editorTextFocus && !editorReadonly"
  82. // },
  83. {
  84. "key": "alt+/", // ctrl+space 改为alt+/
  85. "command": "editor.action.triggerSuggest",
  86. "when": "editorHasCompletionItemProvider && editorTextFocus && !editorReadonly"
  87. },
  88. {
  89. "key": "shift+alt+f", //与shift+alt+f互换,原为shift+alt+f
  90. "command": "rest-client.rerun-last-request",
  91. "when": "editorTextFocus && editorLangId == 'http'"
  92. },
  93. {
  94. "key": "shift+alt+f", //与shift+alt+f互换,原为shift+alt+f
  95. "command": "rest-client.rerun-last-request",
  96. "when": "editorTextFocus && editorLangId == 'plaintext'"
  97. },
  98. {
  99. "key": "shift+alt+f", //与shift+alt+f互换,原为shift+alt+f
  100. "command": "rest-client.rerun-last-request",
  101. "when": "resourceScheme == 'rest-response'"
  102. },
  103. {
  104. "key": "ctrl+.", //原为ctrl+j
  105. "command": "workbench.action.togglePanel"
  106. },
        {
            "key": "ctrl+enter", //原为ctrl+shift+b
            "command": "workbench.action.tasks.build"
        }
  107. ]

参考链接:

用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. 最NB的发现 LINUX 下玩teamviewer 命令行设置密码

    cd /opt/teamviewer/tv_bin/ [root@666 tv_bin]# ls desktop script teamviewerd TVGuiSlave.32 xdg-utils ...

  2. android笔记--与服务器交互更改简历状态

    private AsyncHttpClient asyncHttpClient; private Dialog dialog; /** * 改变简历状态 */ private void postcha ...

  3. 【Socket】linux组播技术

    1.mystery引入      1)本学期学了计算机网络,对一些网络底层的东西还是不大了解    2)目前IP网络流行3种通信模式,分别是单播/广播与组播    3)根据Internet关于IP地址 ...

  4. 使用SpringBoot的yml文件配置时踩的一个坑

    问题描述:使用SpringBoot整合redis进行yml配置的时候,启动工程报错,提示加载application.yml配置文件失败: ::27.430 [main] ERROR org.sprin ...

  5. python中 staticmethod与classmethod区别

    staticmethod与classmethod区别 参考 https://stackoverflow.com/questions/136097/what-is-the-difference-betw ...

  6. Linux各个文件夹的作用~~~非常实用!!

    linux下的文件结构,看看每个文件夹都是干吗用的/bin   二进制可执行命令 /dev 设备特殊文件 /etc 系统管理和配置文件 /etc/rc.d 启动的配置文件和脚本 /home 用户主目录 ...

  7. poj1988(判断一个结点下面有多少个结点,推荐)

    题意:有n个元素,开始每个元素自己一栈,有两种操作,将含有元素x的栈放在含有y的栈的顶端,合并为一个栈.第二种操作是询问含有x元素下面有多少个元素. 6 M 1 6 C 1 M 2 4 M 2 6 C ...

  8. 3. 支持向量机(SVM)拉格朗日对偶性(KKT)

    1. 感知机原理(Perceptron) 2. 感知机(Perceptron)基本形式和对偶形式实现 3. 支持向量机(SVM)拉格朗日对偶性(KKT) 4. 支持向量机(SVM)原理 5. 支持向量 ...

  9. [转]layDate显示默认时间

    原文地址:https://blog.csdn.net/u011870547/article/details/72540074 jsp: <div class="form-group&q ...

  10. MySQL日志——二进制日志

    Mac怎么这么坑呢,搞了2小时了.唉 先来一个简单的,挖好坑,明天解决. 终端进入mysql: mysql> set global general_log=on; 然后进行数据库的任意操作: 查 ...