Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing keyboard shortcut features from Sublime Text #3776

Closed
waderyan opened this issue Mar 7, 2016 · 66 comments
Closed

Missing keyboard shortcut features from Sublime Text #3776

waderyan opened this issue Mar 7, 2016 · 66 comments
Labels
feature-request Request for new features or functionality

Comments

@waderyan
Copy link

waderyan commented Mar 7, 2016

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 #3130 None
ctrl+; None Go to Word #14028 None
ctrl++ cmd++ and cmd+= Increase Font Size #14031 FontSize Shortcuts
ctrl+- cmd+- Decrease Font Size #14031 FontSize Shortcuts
ctrl+shift+m ctrl+shift+m Expand selection to brackets #14089 Bracket Selection
ctrl+shift+j cmd+shift+j Expand selection to indent level #14090 None
alt+q cmd+alt+q Break / Wrap line #14093 None
alt+shift+1 alt+cmd+1 Switch to single column view #14094 None
ctrl+y ctrl+y Repeat #14097 None
ctrl+shift+a cmd+shift+a Expand selection to tag #14098 expand-region
ctrl+shift+space cmd+shift+space Expand selection to scope #14099 expand-region
shift+f11 ctrl+shift+cmd+f Enter distraction free mode #12940 None
ctrl+space ctrl+space Select next auto complete suggestion #14101 None
alt+shift+w ctrl+shift+w Wrap HTML tag #14103 None
alt+. cmd+alt+. Close HTML tag #14104 Close HTML/XML tag
ctrl+k ctrl+6 cmd+k cmd+6 Fold level 6 #14106 None
ctrl+k ctrl+7 cmd+k cmd+7 Fold level 7 #14106 None
ctrl+k ctrl+8 cmd+k cmd+8 Fold level 8 #14106 None
ctrl+k ctrl+9 cmd+k cmd+9 Fold level 9 #14106 None
alt+0 cmd+0 Select open tab index 9 #14095 None

Additionally, here are other actions that are not bound to a keyboard shortcut:

Action Issue Extension
Drag and drop selected text #1046 None
@waderyan waderyan added the feature-request Request for new features or functionality label Mar 7, 2016
@Tyriar
Copy link
Member

Tyriar commented Mar 7, 2016

Is super mapped to ctrl or alt? Surely they don't bind win+<num>

@waderyan
Copy link
Author

waderyan commented Mar 7, 2016

super is win or cmd

@Tyriar
Copy link
Member

Tyriar commented Mar 7, 2016

@waderyan just looked, I don't see any super in the default keybindings on Windows. Is the above the OSX version?

@waderyan
Copy link
Author

waderyan commented Mar 7, 2016

Yes. From the docs it looked like this was the case

@JamesHenry
Copy link

(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.

@waderyan
Copy link
Author

waderyan commented Mar 9, 2016

@JamesHenry not sure how I missed that one. Added now. I don't know of an equivalent command in VS Code.

@JamesHenry
Copy link

Great, thanks. Consider this my +1 :)

@yisibl
Copy link
Contributor

yisibl commented Jun 10, 2016

@JamesHenry In vscode we can used:

cmd + i and

option + shift + i

But I'm very much like the shortcut key to Sublime Text.

@JamesHenry
Copy link

Ah, awesome thanks @yisibl!

Yeah, I have just made it my first ever shortcut override :D

@yisibl
Copy link
Contributor

yisibl commented Jun 10, 2016

By the way, VS Code not support cmd + j

@waderyan waderyan changed the title Missing commands from Sublime keybindings Missing commands from Sublime Oct 19, 2016
@waderyan waderyan changed the title Missing commands from Sublime Missing commands from Sublime Text Oct 20, 2016
@kabirbaidhya
Copy link

It would be awesome if we have all these in vscode 👍

@Tyriar
Copy link
Member

Tyriar commented Oct 27, 2016

@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

@waderyan waderyan changed the title Missing commands from Sublime Text Missing keyboard shortcut features from Sublime Text Oct 29, 2016
@nnur
Copy link

nnur commented Nov 2, 2016

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?

@Zarel
Copy link
Contributor

Zarel commented Nov 2, 2016

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?

@Zarel
Copy link
Contributor

Zarel commented Nov 2, 2016

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.

@kevinSuttle
Copy link

@nnur I have been itching for the same thing. Transpose sort of does it, but not the way we're used to.

@gkalpak
Copy link
Contributor

gkalpak commented Nov 4, 2016

👍 to @Zarel's sublime-commands. The behavior for joining lines and adding cursors to selected lines are closer to Sublime Text's.

@claudio4
Copy link

claudio4 commented Nov 4, 2016

Please also add the crtl + click to add a new cursor.

BTW great work with the extension!

@waderyan
Copy link
Author

waderyan commented Nov 7, 2016

@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.

@rebornix
Copy link
Member

rebornix commented Nov 8, 2016

@waderyan for #9415, we already have all support.

@gkalpak
Copy link
Contributor

gkalpak commented Nov 14, 2016

FWIW, the two main Sublime features I would terribly miss are:

  1. The ability to quickly switch between projects (Project > Quick Switch Project)
  2. Magically restoring my unsaved files when switching between projects or closing/reopening windows.

(But, of course, it is are more about missing functionality than just missing shortcuts.)

@waderyan waderyan assigned rebornix and unassigned waderyan Jul 13, 2017
@albert-001
Copy link

albert-001 commented Jul 25, 2017

shift key down + righ mouse down + dragging, this is very useful for editing multi-lines at the same time.

@mgiraldo
Copy link

mgiraldo commented Oct 13, 2017

i really like sublime's ⌘+T that shows a Go To File... dialog... you then start typing characters in then dialog and files that contain those characters get listed... like a very fuzzy autocomplete

super useful for heavily-foldered projects (rails, react)

edit: never mind! this shortcut is available in Sublime Text Pack!

@cmalard
Copy link

cmalard commented Oct 23, 2017

ctrl+shift+d : duplicate selection (not the whole line)
extension sublime-duplicate-text (not working on VSCode 1.17.2)

@elboletaire
Copy link

elboletaire commented Oct 23, 2017

The "duplicate selection" exists in vscode. It's called copy line down.

BTW, it copies the entire line, not only the selected text.

@cmalard
Copy link

cmalard commented Oct 23, 2017

This is exactly what I'm talking about : duplicate selection, not the whole line ;-)

@djdeo
Copy link

djdeo commented Jan 18, 2018

sublime uses ctrl+shift+; to delete html tags (both open tag and close tag), what's the shortcut in vscode?

@joncalhoun
Copy link

joncalhoun commented Feb 6, 2018

Is there a good way to replicate ST's layouts and their keyboard shortcuts in VSCode, even if it means using another plugin? (screenshot below of the options)

screenshot of st layouts

I can sorta use the split editor keyboard shortcut to constant split editors and go from 1 column to many, and I can use another keyboard shortcut to swap orientation, but there doesn't appear to be any way to create a shortcut like ST's cmd+alt+1 which would merge them all into a single column, which I use quite often.

@jaegz
Copy link

jaegz commented Mar 6, 2018

One of my all time favorite sublime shortcuts which I greatly miss in VS Code...

Select all inside tags / Expand selection outwards
ctrl+, or ctrl+shift+a

@giovannipds
Copy link

What about to ctrl+up and ctrl+down (arrows) to increment / decrement selected numbers? How to achieve it?

@giovannipds
Copy link

Just got it: https://marketplace.visualstudio.com/items?itemName=nmsmith89.incrementor (it's necessary to set the keybindings provided in the page and reload).

@elboletaire
Copy link

elboletaire commented Mar 13, 2018

@giovannipds that is an emmet function, and it's already on vscode. No need for additional plugins.

imatge

@giovannipds
Copy link

@elboletaire right, thank you! I must haven't noticed. But the plugin does some additional stuff like swapping true and false etc., which is also cool. Will let it installed anyway. =D

@tino
Copy link

tino commented May 11, 2018

I'm missing these!

{ "keys": ["super+e"], "command": "slurp_find_string" },
{ "keys": ["super+shift+e"], "command": "slurp_replace_string" },

@giovannipds
Copy link

giovannipds commented May 11, 2018

Is there a way to quickly switch between Workspaces just like SublimeText does with Projects? That's pretty needed... =(

Update: it kinda exists. The most similar way I've found is using Ctrl/Cmd + Shift + P then using File: Open Recent. If your workspaces are there, you can quickly change it there. File > Open Workspace... behaves similar to projects on SublimeText. Another quick tip is having all *.code-workspace files on the same dir so you can use File > Open Workspace... easily.

@rebornix rebornix removed their assignment Sep 18, 2018
@rebornix rebornix added editor-contrib Editor collection of extras and removed editor labels Sep 18, 2018
@alexdima alexdima added editor and removed editor-contrib Editor collection of extras labels Nov 14, 2018
@janderson099
Copy link

I'm missing these!

{ "keys": ["super+e"], "command": "slurp_find_string" },
{ "keys": ["super+shift+e"], "command": "slurp_replace_string" },

super key, on VSCode is win (I'm using win10).
For instance, I did this code on keybinding.json:

{
        "key": "shift+win+l",
        "command": "editor.action.insertSnippet",
        "when": "editorTextFocus",
        "args": {
            "langId": "javascript",
            "name": "Print to console"
        }
    }

I hope this help someone.

@Victor-Bernabe
Copy link

I would like to add "cut from current position to the end of the line". The ctrl + k from Emacs or bash is very handy and I miss a lot this feature.

@andig
Copy link

andig commented Feb 1, 2019

You mean Cmd-Shift-Right Del?

@Victor-Bernabe
Copy link

You mean Cmd-Shift-Right Del?

I mean the possibility to assign that action to a simple shortcut like ctrl + k

@andig
Copy link

andig commented Feb 1, 2019

See #25075

@ddayhtx
Copy link

ddayhtx commented Feb 17, 2019

*FIXED
in case anyone else needs to make this adjustment. It's SUPER simple.

File-Scroll down to Editor:Multi Cursor Modifier-select ctrlCmd BOOM..you're done.

multi cursor select is NOT working. Before I wiped the drives and installed OS in both my machines, the Sublime extension, the ONE thing I want and use the most is no longer working. A month ago, it worked. Now, not on either. I went over the posts above. I am obviously missing something. I'm running Mint 19 Tessa on both machines.

Any thoughts here? I LOVE VSC but without the multi cursor I'm back to Sublime. It's just not the same :(

@mjbvz
Copy link
Collaborator

mjbvz commented May 1, 2019

Closing this aggregate issue as it is out of date

If you have any commands that you would find useful and that are still not supported by VS Code (or added by an existing marketplace extension) please open a new issue

@mjbvz mjbvz closed this as completed May 1, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests