-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
47 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`). |