VSCode 自定义按键 上下左右

这篇博客详细介绍了如何在VSCode中自定义按键绑定,包括使用Alt+I、J、K、L进行上下左右的光标移动,并且列出了不同情境下的多种命令组合,如在列表、调试控制台、设置、参数提示等场景中的快捷操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

// Place your key bindings in this file to overwrite the defaults
// alt + i, j, k,l
[{
"key": "alt+j",
"command": "cursorLeft"
},
{
"key": "alt+j ",
"command": "list.collapse",
"when": "listFocus"
},
{
"key": "alt+k",
"command": "cursorDown"
},
{
"key": "alt+k",
"command": "repl.action.historyNext",
"when": "editorTextFocus && inDebugRepl && onLastDebugReplLine"
}, {
"key": "alt+k",
"command": "settings.action.focusSettingsFile",
"when": "inSettingsSearch"
}, {
"key": "alt+k",
"command": "showNextParameterHint",
"when": "editorTextFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
}, {
"key": "alt+k",
"command": "selectNextSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
}, {
"key": "alt+k",
"command": "keybindings.editor.focusKeybindings",
"when": "inKeybindings && inKeybindingsSearch"
}, {
"key": "alt+k",
"command": "keybindings.editor.focusKeybindings",
"when": "inKeybindings && inKeybindingsSearch"
}, {
"key": "alt+k",
"command": "search.focus.nextInputBox",
"when": "inputBoxFocus && searchViewletVisible"
}, {
"key": "alt+k",
"command": "workbench.action.interactivePlayground.arrowDown",
"when": "interactivePlaygroundFocus && !editorTextFocus"
},
{
"key": "alt+l",
"command": "cursorRight"
},
{
"key": "alt+l",
"command": "repl.action.acceptSuggestion",
"when": "editorTextFocus && inDebugRepl && suggestWidgetVisible"
}, {
"key": "alt+l",
"command": "list.expand",
"when": "listFocus"
},
{
"key": "alt+i",
"command": "cursorUp"
},
{
"key": "alt+i",
"command": "repl.action.historyPrevious",
"when": "editorTextFocus && inDebugRepl && onLastDebugReplLine"
}, {
"key": "alt+i",
"command": "showPrevParameterHint",
"when": "editorTextFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
}, {
"key": "alt+i",
"command": "selectPrevSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
{
"key": "alt+i",
"command": "list.focusUp",
"when": "listFocus"
}, {
"key": "alt+i",
"command": "search.action.focusSearchFromResults",
"when": "firstMatchFocus && searchViewletVisible"
}, {
"key": "alt+i",
"command": "search.action.focusSearchFromResults",
"when": "firstMatchFocus && searchViewletVisible"
}, {
"key": "alt+i",
"command": "workbench.action.interactivePlayground.arrowUp",
"when": "interactivePlaygroundFocus && !editorTextFocus"
}
]
### VSCode 使用教程 #### 功能介绍 Visual Studio Code (简称 VSCode) 是一款由微软开发的轻量级但功能强大的源代码编辑器,支持多种编程语言并可通过插件扩展其能力[^1]。 - **跨平台支持**:适用于 Windows、macOS 和 Linux。 - **内置 Git 控制**:方便版本管理操作。 - **智能感知**:提供语法高亮显示、自动补全等功能来提高编码效率。 - **调试工具集成**:允许直接在编辑器内启动和控制程序执行流程。 - **丰富的插件库**:通过安装不同的插件可以极大地拓展应用的功能范围。 #### 操作指南 ##### 安装与配置 下载官方提供的最新稳定版安装包,并按照提示完成安装过程。首次打开时可以选择同步设置到云端以便于多设备间的一致体验[^2]。 ##### 创建项目结构 利用左侧活动栏中的资源管理器图标快速浏览现有文件夹或导入新的工作区;也可以右键点击空白处新建文件/文件夹以构建项目的初始框架。 ##### 编辑技巧 - **颜色主题切换**:前往 `Preferences` -> `Color Theme` 来改变界面外观风格。 - **键盘快捷键定制**:进入 `File` -> `Preferences` -> `Keyboard Shortcuts` 自定义常用命令对应的按键组合。 - **多光标编辑**:按住 Alt 键拖动鼠标或者按下 Ctrl+Alt+上下箭头可以在多个位置同时输入文字。 ##### 插件市场探索 访问 Extensions 视图 (`Ctrl+Shift+X`) 浏览热门推荐或是搜索特定需求的相关扩展,比如 Python 解析器、Markdown 预览等实用组件。对于有经验开发者来说,“@”符号可用于更精确地定位目标插件。 ```json { "editor.tabSize": 4, "files.autoSave": "afterDelay", "[javascript]": { "editor.formatOnType": true } } ``` 上述 JSON 片段展示了部分可调整的用户偏好设定项,可以根据个人习惯修改这些参数让环境更加贴合自己的工作方式。
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值