Skip to content

Latest commit

 

History

History

completions

Shell completions

To get automatic completions for quick-lint-js's options you can install the provided shell completions.

Testing

If you make changes to shell completions and want to test them, you can try all supported shells using Nix:

$ nix run .#bash
$ nix run .#fish
$ nix run .#powershell
$ nix run .#zsh

Zsh

To install the completions for zsh, you can place the completions/_quick-lint-js file in any directory referenced by $fpath.

If you do not already have such a directory registered through your ~/.zshrc, you can add one like this:

mkdir -p ${ZDOTDIR:-~}/.zsh_functions
echo 'fpath+=${ZDOTDIR:-~}/.zsh_functions' >> ${ZDOTDIR:-~}/.zshrc

Then copy the completion file to this directory:

cp completions/_quick-lint-js ${ZDOTDIR:-~}/.zsh_functions/_quick-lint-js

Bash

To install the completions for bash, you can source the completions/quick-lint-js.bash file in your ~/.bashrc file.

If you do not plan to delete the source folder of quick-lint-js, you can run

echo "source $(pwd)/completions/quick-lint-js.bash" >> ~/.bashrc

Otherwise you can copy it to the ~/.bash_completion folder and source it from there:

mkdir -p ~/.bash_completion
cp completions/quick-lint-js.bash ~/.bash_completion/quick-lint-js
echo "source ~/.bash_completion/quick-lint-js" >> ~/.bashrc

Fish

To install the completions for fish, run

mkdir -p $fish_complete_path[1]
cp completions/quick-lint-js.fish $fish_complete_path[1]/quick-lint-js.fish

PowerShell

To install the completions for powershell, you can dot source the completions/quick-lint-js.ps1 file in your $profile file.

. completions/quick-lint-js.ps1

Or copy the contents of completions/quick-lint-js.ps1 into your $profile file.

Get-Content ./completions/quick-lint-js.ps1 | Out-File -Append $profile