mirror of
https://github.com/octoleo/hosts.git
synced 2024-11-27 23:36:35 +00:00
Reconfigure completion setup.
This commit is contained in:
parent
cd3d9ef2b5
commit
638da3200e
@ -57,6 +57,13 @@ curl -L https://raw.github.com/xwmx/hosts/master/hosts \
|
|||||||
A package for Arch users is also
|
A package for Arch users is also
|
||||||
[available in the AUR](https://aur.archlinux.org/packages/hosts/).
|
[available in the AUR](https://aur.archlinux.org/packages/hosts/).
|
||||||
|
|
||||||
|
### Completions
|
||||||
|
|
||||||
|
`hosts` supports tab completion for bash and zsh. If you install `hosts`
|
||||||
|
with Homebrew, the completion scripts will be installed automatically.
|
||||||
|
When installing `hosts` through other methods, [completion can be
|
||||||
|
enabled with a few commands](etc/README.md).
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Listing Entries
|
### Listing Entries
|
||||||
|
62
etc/README.md
Normal file
62
etc/README.md
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
# Installation instructions
|
||||||
|
|
||||||
|
## Homebrew
|
||||||
|
|
||||||
|
If you're using Homebrew, just run `brew install xwmx/taps/hosts` and the
|
||||||
|
completion scripts will be installed automatically. The extra steps to install
|
||||||
|
`hosts` completion scripts outlined below are *not needed*.
|
||||||
|
|
||||||
|
A one-time setup might be needed to [enable completion for all Homebrew
|
||||||
|
programs](https://docs.brew.sh/Shell-Completion).
|
||||||
|
|
||||||
|
## bash
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
On a current Linux OS (in a non-minimal installation), bash completion should
|
||||||
|
be available.
|
||||||
|
|
||||||
|
Place the completion script in `/etc/bash_completion.d/`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo curl -L https://raw.githubusercontent.com/xwmx/hosts/master/hosts-completion.bash -o /etc/bash_completion.d/hosts
|
||||||
|
```
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
If you aren't installing with homebrew, source the completion script in
|
||||||
|
`.bash_profile`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
if [[ -f /path/to/hosts-completion.bash ]]
|
||||||
|
then
|
||||||
|
source /path/to/hosts-completion.bash
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
|
||||||
|
## zsh
|
||||||
|
|
||||||
|
Place the completion script in your `/path/to/zsh/completion` (typically
|
||||||
|
`~/.zsh/completion/`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ mkdir -p ~/.zsh/completion
|
||||||
|
$ curl -L https://raw.githubusercontent.com/xwmx/hosts/master/hosts-completion.zsh > ~/.zsh/completion/_hosts
|
||||||
|
```
|
||||||
|
Include the directory in your $fpath by adding in `~/.zshrc`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
fpath=(~/.zsh/completion $fpath)
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure compinit is loaded or do it by adding in `~/.zshrc`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
autoload -Uz compinit && compinit -i
|
||||||
|
```
|
||||||
|
|
||||||
|
Then reload your shell:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
exec $SHELL -l
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user