Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Toggle File in Split View by HotkeyNew to Visual Studio Code? Get it now.
Toggle File in Split View by Hotkey

Toggle File in Split View by Hotkey

vsuhanov

|
41 installs
| (0) | Free
Allows you to toggle file in split view
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

toggle-file

Features

Allows you to bind a hotkey that will toggle a file into view.

Triggering the action will open the file in a split view. If it's already open and is visible in any of the split views it will be focused there. If it is currently focused editor it will close it.

Extension Settings

action accepts a fileName and splitType as args

define custom keybind:

{
    "key": "space 1",
    "command": "toggle-file.toggleFile",
    "args": {
        "fileName": "/path/to-your-togglable/file.md"
    },
    "when": "!inputFocus && !editorFocus"
},

How I use it with neovim vscode extension

So far I could not figure out how to configure hotkeys in vscode so that they work in all cases but the insert mode so I configure them in two places like that: in keybindings for vscode

{
    "key": "space 1",
    "command": "toggle-file.toggleFile",
    "args": {
        "fileName": "/Users/vitaly/Daily Notes.md"
    },
    "when": "!inputFocus && !editorFocus"
},

and in my lua config I have the following

keymap({"v", "n"}, "<leader>1", function()
  vscode.call('toggle-file.toggleFile', {
    args = {
      fileName = '/Users/vitaly/Daily Notes.md'
    }
  })
end, opts)
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft