VSCode
Rust10x Extension, Snippets, KeyBindings, and more.
Rust10x VSCode Extension
Install: VSCode Rust10x Extension
For now, the Rust10x VSCode extension is just about some key snippets and some command utilities I am using for Rust coding.
The initial releases include:
- A collection of snippets that I frequently use in my daily Rust programming and in my Rust Production Coding Videos.
- Several Rust coding productivity commands. For now, these include the
eol_commands
For more information check the GitHub rust10x-vscode
Rust10x Extension Keybindings
Here are the key bindings I use with this extension.
(I didn't include them in the extension because they might already be mapped for some users). Also, not all snippet are key binded.
// -- Rust10x Comments
{
"key": "ctrl+c",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": { "name": "10x-comment-section" }
},
{
"key": "ctrl+v",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": { "name": "10x-comment-delimiter" }
},
// -- Rust10x Type Wrap
{
"key": "cmd+ctrl+o",
"when": "editorLangId == rust",
"command": "editor.action.insertSnippet",
"args": { "name": "10x-wrap-option" }
},
{
"key": "cmd+ctrl+r",
"when": "editorLangId == rust",
"command": "editor.action.insertSnippet",
"args": { "name": "10x-wrap-result" }
},
{
"key": "cmd+ctrl+v",
"when": "editorLangId == rust",
"command": "editor.action.insertSnippet",
"args": { "name": "10x-wrap-vec" }
},
{
"key": "cmd+ctrl+a",
"when": "editorLangId == rust",
"command": "editor.action.insertSnippet",
"args": { "name": "10x-wrap-arc" }
},
// -- Rust10x EOLs
{ "key": "cmd+;",
"command": "rust10x.eol_scolon",
"when": "editorLangId == rust && editorTextFocus"
},
{
"key": "cmd+alt+;",
"command": "rust10x.eol_question_scolon",
"when": "editorLangId == rust && editorTextFocus"
},
{
"key": "cmd+ctrl+;",
"command": "rust10x.eol_await_scolon",
"when": "editorLangId == rust && editorTextFocus"
},
{
"key": "cmd+ctrl+alt+;",
"command": "rust10x.eol_await_question_scolon",
"when": "editorLangId == rust && editorTextFocus"
},
// -- Rust10x Open closest error.rs
{
"key": "ctrl+cmd+e",
"when": "editorLangId == rust",
"command": "rust10x.open_error_rs"
},
// -- Rust10x Others
{
"key": "cmd+ctrl+s",
"when": "editorLangId == rust",
"command": "editor.action.insertSnippet",
"args": { "name": "10x-arg-impl-into-string" }
},
Other VSCode Extensions
Here is a list of VSCode extensions I am using:
- rust-analyzer,
- Even Better TOML
- Material Icon Theme
- Toggle (to toggle settins, e.g., inlays and)
- Toggle Quotes ;)
- GitHub CoPilot
Keybinding for toggling the inlays
Install toggle first: Toggle first.
{
"key": "cmd+u",
"command": "toggle",
"when": "editorTextFocus",
"args": {
"id": "toggle_inlay_hints",
"value": [
{
"editor.inlayHints.enabled": "on"
},
{
"editor.inlayHints.enabled": "off"
}
]
}
}
Theme
Color theme: Dark Modern
(includes Material Icon Theme, as mentioned above).
I've also added custom icons for some folders and created mappings between certain extensions/folder-names and icons.