Autocompletion
Autocompletion is a convenient command line feature for displaying suggestions when pressing the TAB button.
- PowerShell
- Zsh
- Bash
- Fish
tuna completion powershell | Out-String | Invoke-Expression
To test, type tuna and press the TAB button several times.
To save settings for future sessions, follow these steps:
- Open PowerShell as Administrator and run the command to allow running custom scripts in the shell:
Set-ExecutionPolicy RemoteSigned
Answer the question with: A (Yes to All).
- Open a new PowerShell window as your user and run the commands one by one:
if (!(Test-Path -Path $PROFILE.CurrentUserAllHosts)) { New-Item -ItemType File -Path $PROFILE.CurrentUserAllHosts -Force }
Add-Content $PROFILE.CurrentUserAllHosts "tuna completion powershell | Out-String | Invoke-Expression"
Or you can edit the file using a text editor:
notepad $PROFILE.CurrentUserAllHosts
Adding the line:
tuna completion powershell | Out-String | Invoke-Expression
source <(tuna completion zsh)
To save settings for future sessions, add to the ~/.zshrc file:
if command -v tuna &>/dev/null; then
eval "$(tuna completion zsh)"
fi
source <(tuna completion bash)
To save settings for future sessions, add to the ~/.bashrc file:
if command -v tuna &>/dev/null; then
eval "$(tuna completion bash)"
fi
tuna completion fish | source
To save settings for future sessions, add to the ~/.config/fish/completions/tuna.fish file:
tuna completion fish