π 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.
Tip
You can use resource names and short name to specify a command the same way as if typed in command mode.
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
Warning
This configuration might change in the future!
# $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