Skip to content

Instantly share code, notes, and snippets.

@rrotter
rrotter / completion.zsh
Created May 24, 2024 21:39
zsh completion for kubectl and anything else
# Adding the following to the _end_ of your zshrc should
# (1) enable completion for most commands
# (2) work on any os zsh and kubectl can be installed on
# (3) enable completion for kubectl even if some common configuration issues are present
# (4) enable zsh completion for aws and tk
# (5) be safe to append to .zshrc without a further thought (please don't)
#
# That being said, you almost certainly don't need every line in this file.
# Reading through this should help you understand zsh completion setup enough
# to choose what to copy for your own configuration.
@rrotter
rrotter / _path_files.diff
Last active October 23, 2024 03:07
fix zsh file completion if you're stuck on an unpatched version of zsh 5.9
site-functions # diff /usr/share/zsh/5.9/functions/_path_files /usr/local/share/zsh/site-functions/_path_files
--- /usr/share/zsh/5.9/functions/_path_files 2024-10-01 00:10:49
+++ XX_path_files 2024-10-19 02:25:56
@@ -145,7 +145,9 @@
if [[ $#matcher -eq 0 && -o nocaseglob ]]; then
# If globbing is case insensitive and there's no matcher,
# do case-insensitive matching.
- matcher=( -M 'm:{a-zA-Z}={A-Za-z}' )
+ # work around bug in zsh 5.9
+ #matcher=( -M 'm:{a-zA-Z}={A-Za-z}' )