This directory contains enhanced shell completion scripts for Smart Tree (st).
- Smart Tab Completion: Complete all flags, options, and modes
- Contextual Tips: Shows helpful tips based on what you're typing
- Mode Descriptions: Each output mode shows its description
- Auto-suggestions: Integration with zsh-autosuggestions
- Common Patterns: Pre-defined aliases for frequent operations
- Interactive Help:
sttipscommand shows tips and tricks
# Using manage.sh
./scripts/manage.sh completions
# Or run the setup script directly
zsh completions/setup_zsh.sh# Copy completion file to your completions directory
cp completions/_st_enhanced ~/.zsh/completions/_st
# Add to ~/.zshrc
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinit
source ~/.config/st/config.zshst <TAB> # Shows path completions and options
st --mode <TAB> # Shows all 18 output modes with descriptions
st . --find <TAB> # Shows tip about using with --mode ls
st . --newer-than <TAB> # Suggests date formatstai # st . --mode summary-ai -z
stfind "pattern" # st . --find "pattern"
stsearch "keyword" # st . --search "keyword"
stwaste # st . --mode waste
stls # st . --mode ls
stquick # Quick 3-level AI summary
strecent # Files changed in last 7 days
sttips # Show tips and tricksWhen you type certain combinations, you'll see contextual tips:
- After
--find: "💡 TIP: Use --mode ls with --find to see full match context" - After
--stream: "💡 TIP: Streaming mode essential for dirs with >100k files" - After
--mode: "💡 TIP: Use 'summary-ai' for 10x compression when working with LLMs"
The setup creates ~/.config/st/config.zsh with:
- Useful aliases
- Auto-suggestion patterns
- Tips function
If you have zsh-autosuggestions installed:
# Install on macOS
brew install zsh-autosuggestions
# Install on Ubuntu/Debian
sudo apt install zsh-autosuggestions
# Install on Arch
sudo pacman -S zsh-autosuggestionsThe completion script will automatically seed your history with common Smart Tree patterns for better suggestions.
Edit ~/.config/st/config.zsh to:
- Add your own aliases
- Modify auto-suggestion patterns
- Customize tips
-
Ensure the completion file is in a directory in your
$fpath:echo $fpath
-
Rebuild completion cache:
rm -f ~/.zcompdump compinit -
Check if completions are loaded:
which _st
- Tips require a terminal that supports ANSI escape codes
- Check if
_messagefunction is available in your zsh
To add new completions or tips:
- Edit
completions/_st_enhanced - Add new patterns to the
argsarray - Add contextual tips in the state machine
- Test with
./scripts/manage.sh completions