Skip to content

kvoon3/vscode-autohide-kb

 
 

Repository files navigation

Auto Hide KB VS Code

Visual Studio Marketplace Version Made with reactive-vscode

Auto Hide VSCode sidebar, panel and notifications, with better keyboard-only usage experience.

New Features

  1. Triggered by cursor, keyboard and commands
  2. Throttle trigger event
  3. Auto/Manual mode switching
  4. Whitelist support
  5. More ui to hide, and Cursor panel compatible
  6. Status bar button

Configurations

Key Description Type Default
autoHide.enable Whether enable Auto Hide boolean true
autoHide.ui UI hideable settings object {"sidebar":true,"auxiliaryBar":true,"panel":true,"references":false,"notifications":true,"cursor":false}
autoHide.triggerOnOpen Whether trigger when open boolean true
autoHide.triggerKind Use which kind of event to trigger hide array ["mouse","command","keyboard"]
autoHide.mode Auto/Manual mode string "auto"
autoHide.throttleTime Throttle trigger time in ms number 500
autoHide.whitelist Set editor whitelist , support RegExp, default match status is focus array ["git","output",{"match":"debug","status":["visible"]}]
autoHide.statusBarText.trigger Status bar item label, See https://code.visualstudio.com/api/references/icons-in-labels#icon-listing to customize icon string "$(eye-closed) Hide"
autoHide.statusBarText.mode Status bar label for mode, use $(mode) to get current mode string,object "-- $(mode) --"
autoHide.navigateFallback Navigate fallback settings object {"left":"sidebar","right":"auxiliaryBar","down":"panel"}

Commands

Command Title
autoHide.toggleEnable Auto Hide: Toggle enable
autoHide.toggleMode Auto Hide: Toggle manual/auto mode
autoHide.runHide Auto Hide: Run hide immediately

Navigate To Panel

Due to the panel being hidden, using the workbench.action.navigateXXX commands to switch panels will be ineffective.

Auto Hide KB provides the following commands as alternatives to VSCode's navigateXXX commands:

Navigate Command Description
autoHide.action.navigateLeft workbench.action.navigateLeft with fallback to Sidebar
autoHide.action.navigateRight workbench.action.navigateRight with fallback to Auxiliary Bar
autoHide.action.navigateDown workbench.action.navigateDown with fallback to Panel
autoHide.action.focusActiveEditorGroupWithHide workbench.action.focusActiveEditorGroup with autoHide

See Config: autoHide.navigateFallback to Customize

Usage example:

Full Example

Navigate to panel:

  1. editor -> panel:

    // keybindings.json
    [
      {
        "key": "ctrl+w down",
        "command": "autoHide.action.navigateDown",
        "when": "editorFocus"
      }
    ]
  2. panel -> editor:

    // keybindings.json
    [
      {
        "key": "ctrl+w up",
        "command": "autoHide.action.focusActiveEditorGroupWithHide",
        "when": "panelFocus"
      }
    ]

Manual Mode

Usage example:

  1. Commands palette:

    Open vscode commands palette with ctrl/cmd+shift+p and search 'Auto Hide: Run hide immediately' to trigger hide.

  2. KeyBinding:

    // keybindings.json
    {
      "key": "ctrl+h",
      "command": "autoHide.runHide",
      "when": "editorFocus"
    }
  3. VSCodeVim:

    // settings.json
    {
      "vim.normalModeKeyBindingsNonRecursive": [
        {
          "after": ["i"],
          "before": ["i"],
          "commands": ["autoHide.runHide"]
        },
        {
          "after": ["j"],
          "before": ["j"],
          "commands": ["autoHide.runHide"]
        },
        {
          "after": ["k"],
          "before": ["k"],
          "commands": ["autoHide.runHide"]
        },
        {
          "after": ["l"],
          "before": ["l"],
          "commands": ["autoHide.runHide"]
        },
        {
          "after": ["h"],
          "before": ["h"],
          "commands": ["autoHide.runHide"]
        }
      ]
    }

Credits

  • Enhanced functionality for VSCode commands, powered by Command Task

License

MIT License © 2020-PRESENT Kevin Kwong & Matthew Spencer