microsoft / vscode-data-wrangler

Other
442 stars 20 forks source link

keyboard shortcut to find a column #339

Closed hottwaj closed 1 week ago

hottwaj commented 1 week ago

I couldn't find a way to "find a column" without using the mouse. Could this be bound to Ctrl+F somehow?

Many thanks!

pwang347 commented 1 week ago

Hi @hottwaj, thanks for opening this issue! I can confirm that it's possible to bind this action to the shortcut combination you'd like as follows:

  1. Open keyboard settings in VS Code (here's how I do it on Mac): Image

  2. Search for dataWrangler.revealColumn and assign your keybinding by double-clicking on the "Keybinding" column Image

Hope this helps!

hottwaj commented 1 week ago

great thanks for quick reply!

hottwaj commented 1 week ago

Sorry another question on this, how can I write the "When" expression in Keyboard Shortcuts so that if I bind "Ctrl+F" to dataWrangler.revealColumn it does not clash with normal "Ctrl+F" behaviour?

if "When" is blank, "Ctrl+F" on normal code editing view no longer works

if I set "When" to "dataWrangler.dataWranglerActive", normal use of "Ctrl+F" works, but it does not work as expected in data wrangler.

Is there a way this can be made to work so that a new keyboard shortcut is not needed just for "find column" in DW?

Thanks!

pwang347 commented 1 week ago

Hi @hottwaj, I think you'll need to use this when condition: dataWrangler.dataViewerActive || dataWrangler.dataWranglerActive

Note that dataWrangler.dataWranglerActive refers specifically to the edit mode being active, while dataWrangler.dataViewerActive refers to viewing mode (which I assume is why your keybinding isn't working). The naming is definitely a bit confusing, and we might want to look into updating these.

Let me know if this works for you!

hottwaj commented 1 week ago

That all works as expected now, thanks very much!