Skip to content

Commit

Permalink
Merge pull request #906 from viconnex/add-completion-documentation
Browse files Browse the repository at this point in the history
Document completion installation
  • Loading branch information
andreynering authored Oct 29, 2022
2 parents ac81dea + 6a369ee commit fdd52d7
Showing 1 changed file with 62 additions and 1 deletion.
63 changes: 62 additions & 1 deletion docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ choco install go-task

This installation method is community owned.


### Scoop

If you're on Windows and have [Scoop][scoop] installed, getting
Expand Down Expand Up @@ -190,6 +189,68 @@ released binary.

:::

## Setup completions

Download the autocompletion file corresponding to your shell.

[All completions are available on the task repository](https://github.com/go-task/task/tree/master/completion).

### bash

First, ensure that you installed bash-completion using your package manager.

Make the completion file executable:

```
chmod +x path/to/task.bash
```

After, add this to your ~/.bash_profile:

```shell
source path/to/task.bash
```

### zsh

Put the `_task` file somewhere in your `$fpath`:

```shell
mv path/to/_task /usr/local/share/zsh/site-functions/_task
```

Ensure that the following is present in your ~/.zshrc:

```shell
autoload -U compinit
compinit -i
```

Zsh version 5.7 or later is recommended.

### fish

Move the `task.fish` completion script:

```shell
mv path/to/task.fish ~/.config/fish/completions/task.fish
```

### PowerShell

Open your profile script with:

```
mkdir -Path (Split-Path -Parent $profile) -ErrorAction SilentlyContinue
notepad $profile
```

Add the line and save the file:

```shell
Invoke-Expression -Command path/to/task.ps1
```

[go]: https://golang.org/
[snapcraft]: https://snapcraft.io/task
[homebrew]: https://brew.sh/
Expand Down

0 comments on commit fdd52d7

Please sign in to comment.