Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Close all editors in split on :q execution

Open rpuhalovich opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

Coming from native Vim, I've always used :q to close a split when it's not needed anymore. Since using VSCode-Vim I've found it a bit frustrating having only the current tab close when using :q.

Describe the solution you'd like

It'd be good to have a boolean user setting that, when toggled to true, will close all tabs in a split when :q is executed.

Believe it or not, I've actually already implemented this with automated tests in my own fork. I'm making this issue retrospectively. It'd be cool to make a PR for this.

Describe alternatives you've considered

For about a year during my old job, I've used the following setting to achieve this behavior. It's pretty hacky though because command rebinding isn't a thing in VSCode-Vim.

{
  "vim.commandLineModeKeyBindingsNonRecursive": [
    { "before": [ "q", "<cr>" ], "commands": [ "workbench.action.closeEditorsInGroup" ] }
  ],
}

rpuhalovich avatar Sep 03 '23 06:09 rpuhalovich

Thanks for that. I was looking for the right binding. I would argue the action could be workbench.action.joinTwoGroups to achieve more vim-like behaviour because vim doesn't close buffers (which I believe are editors in vscode) on :q. What :q is currently doing in VSCodeVim should be :bd.

kopiczko avatar Sep 29 '23 10:09 kopiczko

This should be the default behavior, especially for people that uses "workbench.editor.showTabs": "none" or "workbench.editor.showTabs": "single" this actually makes it confusing.

kennethlieyanto avatar Nov 03 '25 08:11 kennethlieyanto