From 42327d8a2c489428090c9e8f90686c715616b803 Mon Sep 17 00:00:00 2001 From: Johann Gyger Date: Sun, 17 Feb 2019 15:15:20 +0100 Subject: [PATCH] Alias for kubectl that works with completion (#12517) * Alias for kubectl with completion. Use a shorthand alias for `kubectl` that also works with completion. Using completion is great but typing `kubectl` each time is annoying. * Update content/en/docs/reference/kubectl/cheatsheet.md Co-Authored-By: jogy --- content/en/docs/reference/kubectl/cheatsheet.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/content/en/docs/reference/kubectl/cheatsheet.md b/content/en/docs/reference/kubectl/cheatsheet.md index c0af67fa7b..01ee865510 100644 --- a/content/en/docs/reference/kubectl/cheatsheet.md +++ b/content/en/docs/reference/kubectl/cheatsheet.md @@ -29,6 +29,13 @@ source <(kubectl completion bash) # setup autocomplete in bash into the current echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell. ``` +You can also use a shorthand alias for `kubectl` that also works with completion: + +```bash +alias k=kubectl +complete -F __start_kubectl k +``` + ### ZSH ```bash