| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This extension is inspired by spacemacs and aiming to provide similar experience in VSCode. An action menu trigger by space key is implemented to reduce memorization of shortcuts. You can change the editor group, change the file language, and check git status without leaving your keyboard. This provides the speed to shortcut while minimizing typing comparing to fuzzy search in the command palette or shortcut memorizing.
This project was initially started by StreakyCobra as a configuration file for VSCodeVim to be merged in your settings.json file. stevenguh developed on his side stevenguh/spacecode also with the goal to bring Spacemacs bindings to VSCode. After some discussion we agreed to merge the two projects to keep this niche community unified. stevenguh solution was technically better, but this project had a larger community and was better referenced, so it was decided move his extension here and to deprecate stevenguh/spacecode.
If you prefer this project's first approach using settings without an extension, see the vscode-vim branch.
This extension is published as an extension pack, and should install all the necessary extensions for the best-of-the box experience; however, if you do not like the bundled extensions or are not using VSCode Vim, please go to the vscode-which-key for a standalone which key menu function.
After the installation of the extension, a notification will help you to configure both the necessary settings and user bindings. However, the formatting of settings.json and keybindings.json may be lost. You can choose to follow the manual configuration below.
The settings.jsonc and keybindings.jsonc in the repo contains the configurations needed. You can merge them manually to your user's settings.json and keybindings.json.
You can access your user's settings.json and keybindings.json by searching Preference: Open Settings (JSON) and Preference: Open Keyboard Shortcuts (JSON) in the command palette (Ctl+Shift+P)
The following commands can be access through command palette to rerun the automatic configuration step.
VSpaceCode: Configure Default Settings and Keybindings
This command will run the below two commands and is also the command that runs on the welcome notification
VSpaceCode: Configure Default Settings
This command will merge the necessary settings to your user's settings.json
VSpaceCode: Configure Default Keybindings
This command will merge the necessary key bindings to your user's keybindings.json
There are two ways to customize the menu: incrementally, and from scratch. Incrementally is great for when you only need to modify a few bindings from the default. Customizing from scratch is great for total control of the customization.
See KEYBINDINGS.md for default bindings.
The default menu bindings are subject to change before 1.0.0. If you find something that you think it should bind to a particular key by default, or you want a particular command, please open an issue as a feature request.
Using this option will allow to you surgically update the default bindings (vspacecode.bindings). The extension will override bindings sequentially base on vspacecode.bindingOverrides.
The following json will replace <SPC> g s in the same position if the binding exists in vspacecode.bindings, and append s to menu <SPC> g if it doesn't exists. This override will only execute if <SPC> g menu exists. An optional position key can be used to specified index of where the item should be inserted/moved to.
The following example will replace/append the whole <SPC> g menu with one binding s in it.
{
"vspacecode.bindingOverrides": [
{
"keys": "g",
"name": "Go...",
"type": "bindings",
"bindings": [
{
"key": "s",
"name": "Go to",
"type": "command",
"command": "workbench.action.gotoLine",
}
]
}
]
}If the key binding's key uses character . like <SPC> e ., you can target that by using an array in the keys like "keys": ["e", "."].
Any negative number in position is denoting a removal operation. In the following example, any item bound to <SPC> g s will be remove.
{
"vspacecode.bindingOverrides": [
{
"keys": "g.s",
"position": -1,
}
]
}To customize the menu items from scratch, you can override the menu completely by putting your own vspacecode.bindings into your settings.json. Using this option will prevent any update to your own bindings.
An example of a settings.json file that overrides space menu is as follows:
{
"vspacecode.bindings": [
{
"key": "f",
"name": "File...",
"type": "bindings",
"bindings": [
{
"key": "f",
"name": "Open file",
"type": "command",
"command": "workbench.action.files.openFileFolder"
},
{
"key": "i",
"name": "Indentation...",
"type": "bindings",
"bindings": [
{
"key": "i",
"name": "Change indentation",
"type": "command",
"command": "changeEditorIndentation"
},
{
"key": "d",
"name": "Detect indentation",
"type": "command",
"command": "editor.action.detectIndentation"
}
]
}
]
}
]
}The default value can be found in the contributes.configuration.vspacecode.bindings.default section of the package.json in this repo. You can use the default value as an example to craft your own custom menu.
This section contains additional config that might be helpful beyond the default bindings
To navigate all the windows including slide and bottom pane with Ctl-h/j/k/l, you can merge the following config system's key bindings to your keybindings.json file.
keybindings.jsonThis config might be in conflict with "Easy List Navigation" below.
[
{
"key": "ctrl+h",
"command": "workbench.action.navigateLeft",
"when": "!inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible"
},
{
"key": "ctrl+j",
"command": "workbench.action.navigateDown",
"when": "!inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible"
},
{
"key": "ctrl+k",
"command": "workbench.action.navigateUp",
"when": "!inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible"
},
{
"key": "ctrl+l",
"command": "workbench.action.navigateRight",
"when": "!inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible"
}
]Although VSCode Vim already bound these to h/j/k/l, however, they might not work in all lists like in the problem pane. You can merge the following keybindings to keybindings.json to bind ctrl+h/l/j/k for those situations.
keybindings.jsonThis config might be in conflict with "Quick Window Navigation" above.
[
{
"key": "ctrl+h",
"command": "list.collapse",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+l",
"command": "list.expand",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+j",
"command": "list.focusDown",
"when": "listFocus && !inputFocus"
},
{
"key": "ctrl+k",
"command": "list.focusUp",
"when": "listFocus && !inputFocus"
}
]File browser, which is bound to <spc> f f by default, binds ctrl+a to open an action menu; however, ctrl+a can be used move the text cursor to the front. Your can merge the following example keybindings to keybindings.json to use ctrl+o instead of ctrl+a in the file browser to open an action menu.
keybindings.json
[
{
"key": "ctrl+a",
"command": "-file-browser.actions",
"when": "inFileBrowser"
},
{
"key": "ctrl+o",
"command": "file-browser.actions",
"when": "inFileBrowser"
}
]See in vscode-which-key
See in vscode-which-key
See CHANGELOG.md
All feature requests and help are welcome. Please open an issue to track.
Thanks @kahole for his implementation of quick pick menu in edamagit.
| Back | FazBrowse Home | New Git URL |
{ "vspacecode.bindingOverrides": [ { "keys": "g.s", "name": "Go to line", "type": "command", "command":"workbench.action.gotoLine", } ] }