安装插件
需要安装vim插件。
如何在不同的区域切换
C代表ctrl
- 侧边栏焦点定位
<C-0>
打开关闭<C-B>
- 编辑区用
<C-1>
- 终端打开关闭
<C-`>
文件/文件夹的增删改查如何操作
参考阿崔的设置 需要在keybindings.json中设置
键 | 含义 |
---|---|
<C+;> | 可以在编辑区和侧边栏来回切换 |
C-q | 关闭工作区 |
C-b | 侧边栏关闭打开 |
焦点在侧边栏 | 含义 |
a | 新建文件 |
shift+a | 新建文件夹 |
r | 重命名 |
d | 删除文件/文件夹 |
c | 剪切文件 |
y | 复制文件 |
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+;",
"command": "workbench.view.explorer",
"when": "viewContainer.workbench.view.explorer.enabled"
},
{
"key": "y",
"command": "filesExplorer.copy",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "c",
"command": "filesExplorer.cut",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "a",
"command": "explorer.newFile",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "shift+a",
"command": "explorer.newFolder",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "r",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "d",
"command": "deleteFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "ctrl+q",
"command": "workbench.action.closeActiveEditor"
},
{
"key": "ctrl+b",
"command": "-extension.vim_ctrl+b",
"when": "editorTextFocus && vim.active && vim.use<C-b> && !inDebugRepl && vim.mode != 'Insert'"
}
]
settings.json中设置
改键 | 含义 |
---|---|
H | 对应成^ |
L | 对应末尾g_ |
leader + r | 改名称 |
leader + n + d | 新建文件夹 |
leader + n + f | 新建文件 |
// visual模式下
"vim.visualModeKeyBindings": [
{
"before": [
"H"
],
"after": [
"^"
]
},
{
"before": [
"L"
],
"after": [
"g",
"_"
]
},
],
// insert模式下键映射
"vim.insertModeKeyBindings": [
{
"before": [
"j",
"j"
],
"after": [
"<Esc>"
]
}
],
// normal模式下
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": [
"ctrl",
"q",
],
"commands": [
"editor.action.closeActiveEditor"
]
},
{
"before": [
"<leader>",
"r",
],
"commands": [
"editor.action.rename"
]
},
{
"before": [
"<leader>",
"n",
"d"
],
"commands": [
"explorer.newFolder"
]
},
{
"before": [
"<leader>",
"n",
"f"
],
"commands": [
"explorer.newFile"
]
},
{
"before": [
"H"
],
"after": [
"^"
]
},
{
"before": [
"L"
],
"after": [
"g",
"_"
]
},
{
"before": [
"<leader>",
"d"
],
"after": [
"d",
"d"
]
},
{
"before": [
"<C-n>"
],
"commands": [
":nohl"
]
},
{
"before": [
"K"
],
"commands": [
"lineBreakInsert"
],
"silent": true
}
],
"vim.operatorPendingModeKeyBindings": [
{
"before": [
"H"
],
"after": [
"^"
]
},
{
"before": [
"L"
],
"after": [
"g",
"_"
]
},
],