Skip to content

Commit

Permalink
doc: several updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Feb 3, 2022
1 parent bd59306 commit 6ad36ab
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 38 deletions.
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [carapace-bin](./carapace-bin.md)
- [Installation](./installation.md)
- [Setup](./setup.md)
- [Completers](./completers.md)
- [Development](./development.md)
- [Build](./development/build.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/carapace-bin.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# carapace-bin

Multi-shell multi-command argument completer based on [rsteube/carapace](https://github.com/rsteube/carapace).
[carapace-bin](https://github.com/rsteube/carapace-bin) is a multi-shell multi-command argument completer based on [rsteube/carapace](https://github.com/rsteube/carapace).

[![asciicast](https://asciinema.org/a/357191.svg)](https://asciinema.org/a/357191)

Expand Down
6 changes: 6 additions & 0 deletions docs/src/development/build.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Build

Execute [`go generate`] and build with the `release` [tag](https://www.digitalocean.com/community/tutorials/customizing-go-binaries-with-build-tags) for a performance optimized build.
Executing [`go generate`] again is only required when a new completer is added.

```sh
cd cmd/carapace && go generate ./... && go build -ldflags="-s -w" -tags release
```

Completers can also be built separately:

```sh
cd completers/ln_completer && go build -ldflags="-s -w"
./ln_completer _carapace [bash|elvish|fish|nushell|oil|powershell|tcsh|xonsh|zsh]
```

[`go generate`]:https://go.dev/blog/generate
37 changes: 0 additions & 37 deletions docs/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,3 @@ Install from [rsteube/scoop-bucket](https://github.com/rsteube/scoop-bucket)
scoop bucket add rsteube https://github.com/rsteube/scoop-bucket.git
scoop install carapace-bin
```
# Setup

Depending on your shell, use the following changes to the required config files:

```sh
# bash (~/.bashrc)
source <(carapace _carapace)

# elvish (~/.elvish/rc.elv)
eval (carapace _carapace|slurp)

# fish (~/.config/fish/config.fish)
mkdir -p ~/.config/fish/completions
carapace --list | awk '{print $1}' | xargs -I{} touch ~/.config/fish/completions/{}.fish # disable auto-loaded completions (#185)
carapace _carapace | source

# nushell [needs fork: https://github.com/rsteube/nushell]
carapace _carapace nushell | save carapace.nu ; nu -c 'source carapace.nu'

# oil (~/.config/oil/oshrc)
source <(carapace _carapace)

# powershell (~/.config/powershell/Microsoft.PowerShell_profile.ps1)
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
carapace _carapace | Out-String | Invoke-Expression

# tcsh (~/.tcshrc)
set autolist
eval `carapace _carapace`

# xonsh (~/.config/xonsh/rc.xsh)
COMPLETIONS_CONFIRM=True
exec($(carapace _carapace))

# zsh (~/.zshrc)
source <(carapace _carapace)
```
39 changes: 39 additions & 0 deletions docs/src/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Setup

Depending on your shell, add the following changes to the corresponding config files:

```sh
# bash (~/.bashrc)
source <(carapace _carapace)

# elvish (~/.elvish/rc.elv)
eval (carapace _carapace|slurp)

# fish (~/.config/fish/config.fish)
mkdir -p ~/.config/fish/completions
carapace --list | awk '{print $1}' | xargs -I{} touch ~/.config/fish/completions/{}.fish # disable auto-loaded completions (#185)
carapace _carapace | source

# nushell [needs fork: https://github.com/rsteube/nushell]
carapace _carapace | save carapace.nu ; nu -c 'source carapace.nu'

# oil (~/.config/oil/oshrc)
source <(carapace _carapace)

# powershell (~/.config/powershell/Microsoft.PowerShell_profile.ps1)
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
carapace _carapace | Out-String | Invoke-Expression

# tcsh (~/.tcshrc)
set autolist
eval `carapace _carapace`

# xonsh (~/.config/xonsh/rc.xsh)
COMPLETIONS_CONFIRM=True
exec($(carapace _carapace))

# zsh (~/.zshrc)
source <(carapace _carapace)
```

> This registers all the available [completers](./completers.md). It is also possible to load a single one by replacing `_carapace` with the completer name (e.g. `carapace chmod`).

0 comments on commit 6ad36ab

Please sign in to comment.