I believe that this is not covered by the Preview feature. I simply want to open a file for editing via Quick Open (or any way?) and replace the contents of the active tab, closing the open file and replacing it with the new one.
This behavior is central to the way I edit. Currently, I'm always opening new tabs that I don't want. It's the only barrier left between Code and the way I've used Vim for 15 years. I imagine that this is scriptable, but would like to avoid going down that road. Please tell me I'm missing something.
(1) The drastic approach: search for these in your settings:
Workbench > Editor > Limit: Enabled
enable this
Workbench > Editor > Limit: Value
set to 1
Drastic, because it will limit you to only 1
editor tab, probably not what you want but it does reuse the active (and only tab) of course.
(2) The macro approach:
Using a macro extension like multi-command put this into your settings.json
"multiCommand.commands": [
{
"command": "multiCommand.openFileInActiveEditor",
"sequence": [
"workbench.action.closeActiveEditor",
"workbench.action.acceptSelectedQuickOpenItem",
"workbench.action.closeQuickOpen" // if you want to close the quickopen panel immediately
]
}
]
and in keybindings.json:
{
"key": "alt+0", // whatever you want
"command": "extension.multiCommand.execute",
"args": { "command": "multiCommand.openFileInActiveEditor" },
"when": "inFilesPicker && inQuickOpen"
},
It appears that you cannot override the usual right keybinding from the quickOpen panel so I set it to alt+right instead but you can pick whatever you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With