Missing keyboard shortcut features from Sublime Text
I created an extension to port Sublime keybindings to VS Code keybindings. I made a list of all the key bindings that were missing analogous commands in VS Code.
Here is the list roughly ordered by importance. Please let me know about more I missed in the comments. If an extension exists with the functionality I added it in the far right column.
| Windows / Linux | Mac | Description | Issue | Extension |
|---|---|---|---|---|
| ctrl+left mouse click | cmd+left mouse click | Add multi cursors | https://github.com/Microsoft/vscode/issues/3130 | None |
| ctrl+; | None | Go to Word | https://github.com/Microsoft/vscode/issues/14028 | None |
| ctrl++ | cmd++ and cmd+= | Increase Font Size | https://github.com/Microsoft/vscode/issues/14031 | FontSize Shortcuts |
| ctrl+- | cmd+- | Decrease Font Size | https://github.com/Microsoft/vscode/issues/14031 | FontSize Shortcuts |
| ctrl+shift+m | ctrl+shift+m | Expand selection to brackets | https://github.com/Microsoft/vscode/issues/14089 | Bracket Selection |
| ctrl+shift+j | cmd+shift+j | Expand selection to indent level | https://github.com/Microsoft/vscode/issues/14090 | None |
| alt+q | cmd+alt+q | Break / Wrap line | https://github.com/Microsoft/vscode/issues/14093 | None |
| alt+shift+1 | alt+cmd+1 | Switch to single column view | https://github.com/Microsoft/vscode/issues/14094 | None |
| ctrl+y | ctrl+y | Repeat | https://github.com/Microsoft/vscode/issues/14097 | None |
| ctrl+shift+a | cmd+shift+a | Expand selection to tag | https://github.com/Microsoft/vscode/issues/14098 | expand-region |
| ctrl+shift+space | cmd+shift+space | Expand selection to scope | https://github.com/Microsoft/vscode/issues/14099 | expand-region |
| shift+f11 | ctrl+shift+cmd+f | Enter distraction free mode | https://github.com/Microsoft/vscode/issues/12940 | None |
| ctrl+space | ctrl+space | Select next auto complete suggestion | https://github.com/Microsoft/vscode/issues/14101 | None |
| alt+shift+w | ctrl+shift+w | Wrap HTML tag | https://github.com/Microsoft/vscode/issues/14103 | None |
| alt+. | cmd+alt+. | Close HTML tag | https://github.com/Microsoft/vscode/issues/14104 | Close HTML/XML tag |
| ctrl+k ctrl+6 | cmd+k cmd+6 | Fold level 6 | https://github.com/Microsoft/vscode/issues/14106 | None |
| ctrl+k ctrl+7 | cmd+k cmd+7 | Fold level 7 | https://github.com/Microsoft/vscode/issues/14106 | None |
| ctrl+k ctrl+8 | cmd+k cmd+8 | Fold level 8 | https://github.com/Microsoft/vscode/issues/14106 | None |
| ctrl+k ctrl+9 | cmd+k cmd+9 | Fold level 9 | https://github.com/Microsoft/vscode/issues/14106 | None |
| alt+0 | cmd+0 | Select open tab index 9 | https://github.com/Microsoft/vscode/issues/14095 | None |
Additionally, here are other actions that are not bound to a keyboard shortcut:
| Action | Issue | Extension |
|---|---|---|
| Drag and drop selected text | https://github.com/Microsoft/vscode/issues/1046 | None |
- Customize keybinding support in menus (see this comment https://github.com/Microsoft/vscode/issues/3776#issuecomment-260324787)
- Customize keybinding support in viewlets (see this https://github.com/Microsoft/vscode/issues/4557)
Is super mapped to ctrl or alt? Surely they don't bind win+<num>
super is win or cmd
@waderyan just looked, I don't see any super in the default keybindings on Windows. Is the above the OSX version?
Yes. From the docs it looked like this was the case
(Hopefully) new VSCode convert here! One of my most used commands in sublime is shift + cmd + l which sublimes calls 'Split into Lines' (under "Selection" menu).
It creates a new cursor for each line of a given selection. Does this functionality exist in VSCode? I cannot see it in the list of missing bindings @waderyan compiled above, but I also cannot seem to find it in VSCode.
@JamesHenry not sure how I missed that one. Added now. I don't know of an equivalent command in VS Code.
Great, thanks. Consider this my +1 :)
@JamesHenry In vscode we can used:
cmd + i and
option + shift + i
But I'm very much like the shortcut key to Sublime Text.
Ah, awesome thanks @yisibl!
Yeah, I have just made it my first ever shortcut override :D
By the way, VS Code not support cmd + j
It would be awesome if we have all these in vscode :+1:
@kabirbaidhya you can install the Sublime Keymap extension that @waderyan built right now. If you find any issues you can file them to the repo https://github.com/Microsoft/vscode-sublime-keybindings/issues
My #1 most used sublime shortcut is:
Ctrl + ⇧ + ↑ Move line/selection up Ctrl + ⇧ + ↓ Move line/selection down
Any chance of adding these to the extension?
I wrote an implementation of Join Lines and Transpose (and some other Sublime commands) which are more faithful to how Sublime implements them:
https://marketplace.visualstudio.com/items?itemName=Zarel.sublime-commands
I generally don't think it's a big deal to copy another editor's behavior exactly, but in this case, the main difference is that Sublime's behavior is less buggy. Specifically:
- transpose crashes when some selections are empty and others aren't; sublime-commands transposes them as expected
- transpose behaves weirdly when there are three or more selections; sublime-commands transposes them like Sublime Text
- join-lines crashes when a cursor is on the last line, sublime-commands doesn't
- join-lines doesn't join the last line of a multiline selection, sublime-commands does (matching Sublime Text's behavior)
If you agree that these are better, could you update the readme in https://github.com/Microsoft/vscode-sublime-keybindings and this issue to refer to those?
Also: Would you be opposed to pull requests adding these features directly into VS Code itself? These features are presumably broadly useful enough to be built-in to Sublime, and then we wouldn't need to install extensions to get access to them.
@nnur I have been itching for the same thing. Transpose sort of does it, but not the way we're used to.
:+1: to @Zarel's sublime-commands. The behavior for joining lines and adding cursors to selected lines are closer to Sublime Text's.
Please also add the crtl + click to add a new cursor.
BTW great work with the extension!
@claudio4 added!
To all - any thoughts on prioritizing the above table? I think join lines is high, followed by ctrl+click to add new cursor. From my experience, I really miss paste and indent. More feedback is appreciated. We have working through a couple of these on our iteration plan for this month.
@waderyan for #9415, we already have all support.