compdef is handy
2026-01-02
Most of the time when I need autocompletion on the terminal I really just need it for files and folders. With zsh this works out of the box when you use most known linux commands, but chains of Python commands can totally flunk here.
Enter compdef, so for marimo I added the following two lines to my ~/.zshrc:
# Enable file completion for uvx commands
compdef _default uvx
# Add uvx marimo alias
alias mam="uvx marimo -y edit --sandbox --watch"
This adds a nice marimo alias but it also makes sure that the alias gets the file autocompletion.