Vscode: Command-E on Mac behaves differently from other applications

Created on 24 Feb 2016  路  17Comments  路  Source: microsoft/vscode

In most Mac applications, pressing Command-E fills the find buffer with the currently selected text. However, in Visual Studio Code, it appears to invoke the Quick Open menu.

bug verified

Most helpful comment

I too found this super confusing. Command-E is core to text editing on the Mac I feel.

Maybe this should be added as documentation? I think on the Mac, quite a lot of people would want to make the above keybindings change.

All 17 comments

We chose 鈱楨 for one of the most powerful actions in the editor itself. With it you can quickly navigate to any file as well as navigate back in history. I must say it's my most used shortcut in all of Code. Give it a spin!

In any case, you can always overwrite this in your keybindings file to the behaviour that you suggested:

{ "key": "cmd+e", "command": "editor.action.nextSelectionMatchFindAction", "when": "editorFocus" }

Command-E isn't even documented on the Visual Studio code site, and it's a duplicate of Command-P.

Why does an undocumented, duplicate shortcut need to take precedence over standard system behavior?

Good point about being a duplicate: I argue that its a way to trigger it using only the left hand.

Good point about the lack of documentation. Ping @chrisdias @seanmcbreen @waderyan, when are we going to talk about 鈱楨 as the greatest keybinding ever?

Adding @gregvanl

I too found this super confusing. Command-E is core to text editing on the Mac I feel.

Maybe this should be added as documentation? I think on the Mac, quite a lot of people would want to make the above keybindings change.

I vote for not overriding a default system-wide shortcut people are used to on other systems 鈱楨 on mac for putting text in copy buffer.

Not sure if this is still open or not, ideally there is a command to support the mac cmd-e, cmd-g behavior.

@joaomoreno, where is the best place to file this feature request? Thanks!

cc @bpasero

I never use Cmd+E so do not ping me or I will remove it if I read more about this issue :)

@alexandrudima I am fine adding this (pressing Cmd+E moves the selected text into the find widget). Do we already have a place where I can add it and maybe have this action already, just bound to a different keybinding?

@bpasero The action exists and is called "actions.find"

@alexandrudima, @bpasero thanks for actions.find!

From using Atom and VSCode there seems to be a difference in how each operating system handles the concept of a "find pasteboard".

MacOS supports several system-level named pasteboards:

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/PasteboardGuide106/Articles/pbConcepts.html

NSFindPboard is the one that cmd-e/cmd-g use. I can use cmd-e to copy text in Chrome, TextEdit, Sublime, TextMate and then switch to another app and use cmd-g to search for that text.

Based on actions.find in VSCode, each open buffer seems to have it's own (non-shared) find pasteboard. So actions.find works fine in a single buffer, but I can't cmd-e some text in one file, then cmd-g it in my next file...

Full support of the system NSFindPboard would be ideal, but allowing actions.find (or similar) to allow for easy searching in other open buffers would handy as well.

For reference, this has also come up in the Atom issue trackers (https://github.com/atom/atom/issues/4650).

I'm really liking the level of polish in VSCode, and it's made me far more efficient in writing NodeJS code full time :) Anything that can be done to enable this workflow would be most welcome.

Thanks again!

@xmas your request should go into a new issue idealy.

@bpasero was a new ticket opened? I'd say this is a usability defect when working on macOS.

Seems we may need to add a new API to electron.

No ticket opened so far.

@joaomoreno editor.action.nextSelectionMatchFindAction as you describe above does not enable the behavior that cmd-e has in pretty much every Mac application (not just editors) .

cmd-e is usually called "Use Selection for Find". It does exactly that. The current selection does not change. But when you hit cmd-g it will use selection to search. Is there any way to get this behavior in TS Code?

Using "actions.find" only works as a substitute if you leave the setting "editor.find.seedSearchStringFromSelection" set to true. And in that case, it's just a duplicate mapping of 鈱楩.

I have "editor.find.seedSearchStringFromSelection" set to false. When I press 鈱楩, sometimes I want to search again for the text that's already in the search buffer. The default behavior is that if you have multiple characters selected when you press 鈱楩 then you begin searching for whatever you had selected.

So now my only way to select some text and search for it is:

  • 鈱楥 (copy selected text)
  • 鈱楩 (open search... at this point the search buffer might have old search text in it)
  • 鈱榁 (paste in new search text)

As others have stated, the desired behavior would be that selecting text and searching can be accomplished with:

  • 鈱楨 (put selected text in search buffer)
  • 鈱楩 (open search)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

TurkeyMan picture TurkeyMan  路  411Comments

Tyriar picture Tyriar  路  314Comments

ghost picture ghost  路  234Comments

Tyriar picture Tyriar  路  204Comments

Brakkar picture Brakkar  路  364Comments