vscode 自定义快捷键
2024-10-19 06:27:38
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"
}
]
参考链接:
另:如果想偷懒,有个code runner的插件可以试一下~
最新文章
- Navisworks API 简单二次开发 (自定义工具条)
- mysql查询数据返回touple改为字典的方法
- unity3d基础02
- Android调用天气预报的WebService简单例子
- JQuery操作Ajax
- python install 2.7.10
- 每日一“酷”之Queue
- android脚步---设置layout隐藏属性
- Hibernate的一个简单应用例子
- .NETCore 千星项目模块化开发框架 SimplCommerce 详解
- Java对字符串加密并返回星号※
- 花了几天学习了vue跟做的仿制app
- 小程序上传wx.uploadFile - 小程序请假
- pip install 报错
- Linux kernel Programming - Allocating Memory
- cocos2dx - Lua 语言
- java.security.NoSuchAlgorithmException: AES KeyGenerator not available
- Beautiful Soup (一)
- bzoj 2286(洛谷 2495) [Sdoi2011]消耗战——虚树
- Oracle LOOP循环控制语句
热门文章
- 数据库的ACID
- [Windows Azure] .NET Multi-Tier Application Using Storage Tables, Queues, and Blobs - 1 of 5
- ffmpeg转码参数设置
- 【转】Linux mysql停止失败的解决办法 Stopping MySQL database server mysqld [fail]
- 解析虚拟VMware三种网络模式的根本区别
- [转]JS组件系列——表格组件神器:bootstrap table
- mysql 通过使用联全索引优化Group by查询
- Linux watchdog 关闭退出功能
- PostgreSQL Table Partitioning<;转>;
- STM32f103的数电采集电路的双ADC的设计与使用