πŸ”‘ Define hotkeys for maximum productivity!

Hot, Hotter, πŸ”₯πŸ”‘

Quick overview

Config file
$XDG_DATA_HOME/k9s/hotkeys.yaml
Format
hotKeys top-level object with items in format
shortCut:    String
description: String
command:     String

See complete example below

Overview

Entering the command mode and typing a resource name or alias could be cumbersome for navigating thru often visited resources. By leveraging hotkeys, k9s can be configured to quickly navigate to your favorite resources. To enable custom hotkeys, first create a config file in $XDG_DATA_HOME/k9s/hotkeys.yaml, then add your hotkeys to the new and shiny hotkeys.yaml file.

Not feeling so hot? Your custom hotkeys will be listed in the help view, which can be accessed by typing ?. The hotkey file will be automatically reloaded so you can readily use your hotkeys as you define them.

You can choose any keyboard shortcuts that make sense to you, provided they are not part of the standard k9s shortcuts list.

Example

# $XDG_DATA_HOME/k9s/hotkeys.yaml
hotKeys:

  # Hitting Shift-0 navigates to your pod view matching pods with labels app=kindnet
  shift-0:
    shortCut:    Shift-0
    description: Viewing pods
    command:     pods app=kindnet

  # Hitting Shift-1 navigates to your deployments
  shift-1:
    shortCut:    Shift-1
    description: View deployments
    command:     dp # <-- A shortcode `dp` can be used instead of `deployments`

  # Hitting Shift-2 navigates to your xray deployments
  shift-2:
    shortCut:    Shift-2
    description: XRay Deployments
    command:     xray deploy
Last modified September 30, 2024: docs: add docs for hotkeys (d1335ef)