Skip to content

Instantly share code, notes, and snippets.

@guersam
Last active August 6, 2025 00:22
Show Gist options
  • Save guersam/9fb7d62c84c033089fd5360ad9270cf7 to your computer and use it in GitHub Desktop.
Save guersam/9fb7d62c84c033089fd5360ad9270cf7 to your computer and use it in GitHub Desktop.
Fish autocompletion for mill 1.0
# Mill completion for fish shell
# Ported from Mill's bash/zsh completion script
function __mill_completions
# Get current command line tokens
set -l tokens (commandline -opc)
set -l position (count $tokens)
# Get completions from mill and strip descriptions
if test -x ./mill
./mill --tab-complete $position $tokens 2>/dev/null | sed 's/ .*//'
else
mill --tab-complete $position $tokens 2>/dev/null | sed 's/ .*//'
end
end
# Register the completion
complete -c mill -f -a "(__mill_completions)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment